两种方法
-
Grant privileges. As root user execute:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
-
bind to all addresses:
The easiest way is to comment out the line in your my.cnf file:#bind-address = 127.0.0.1 and restart mysql service mysql restart
MySql 5.7 简单密码禁止修改的问题
create a six character password in mysql 5.7
It's possible to entirely disable the password "plugin" that seems overly strict by running the following: uninstall plugin validate_password
Should you need it again you can turn it back on via: INSTALL PLUGIN validate_password SONAME 'validate_password.so'
Optionally, you could disable it, set your password and re-enable it:
uninstall plugin validate_password;
CREATE USER 'newsier'@'localhost' IDENTIFIED BY 'special';
INSTALL PLUGIN validate_password SONAME 'validate_password.so';
Further reading:
https://dev.mysql.com/doc/refman/5.7/en/server-plugin-loading.html
https://dev.mysql.com/doc/refman/5.7/en/validate-password-plugin-installation.html