Flask-AppBuilder

安裝 MySQL 伺服器

  1. 安裝:sudo apt install mysql-server
  2. 初始設定:
    1. Would you like to setup VALIDATE PASSWORD component? Y
    2. There are three levels of password validation policy:

      LOW Length >= 8
      MEDIUM Length >= 8, numeric, mixed case, and special characters
      STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

      Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2

    3. Skipping password set for root as authentication with auth_socket is used by default.
      If you would like to use password authentication instead, this can be done with the “ALTER_USER” command.
      See https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-password-management for more information.
    4. Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
    5. Normally, root should only be allowed to connect from
      ‘localhost’. This ensures that someone cannot guess at
      the root password from the network.

      Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y

    6. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
    7. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
  3.  設定密碼
    1. 執行 MySQL:sudo mysql
    2. 設定密碼:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '{NEW_PASSWORD}';
      FLUSH PRIVILEGES;
    3. 離開 MySQL:quit
    4. 再次進入 MySQL 確認密碼是否設定成功:mysql -u root -p

Flask-SQLAlchemy

sudo pip install Flask-SQLAlchemy pymysql

Flask-AppBuilder

sudo pip install Flask-AppBuilder

Last Updated on 2025/12/11 by A1go

目錄
Bitnami