python manager.py db init # 初始化迁移文件,系统默认生成migrate文件夹
python manager.py db migrate # 检查模型字段是否修改,如果改变,就产生新的迁移文件
python manager.py db upgrade # 对迁移文件进行迁移
python manager.py db migrate # 检查模型字段是否修改,如果改变,就产生新的迁移文件
python manager.py db upgrade # 对迁移文件进行迁移
Role.insert_roles()
Source.insert_sources()
Menu.insert_menus()
BlogCount.insert_count()
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK,0 rows affected (0.02sec)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
Query OK,0 rows affected (0.01sec)
mysql> flush privileges;
Query OK,0 rows affected (0.01sec)
进入到mysql目录下:
cd /usr/local/mysql/bin/
sudo su
输入密码之后终端出现:
sh-3.2#
再输入:
./mysqld_safe --skip-grant-tables &
数据库就会重新启动了
再输入:
./mysql
免登录进入成功:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.16 MySQL Community Server - GPL
use mysql;
把之前密码清空:
update user set authentication_string='' where user='root';
刷新:
flush privileges;
设置密码:
ALTER user 'root'@'localhost' IDENTIFIED BY '密码';
刷新一下:
flush privileges;
退出:
quit;
博文最后更新时间: