sudo mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
vim /etc/mysql/mysql.conf.d/mysqld.cnf
- 添加validate_password_policy=LOW
sudo mysql_secure_installation
- 设置密码