First, preparation
1, the virtual machine / machine mysql physical environment (non-native)
2, navicat native software (remote connection verification)
Two, mysql configuration
1, the root user connected to the remote host mysql native
mysql -u root -p
Note: mysql -u username -p highest authority re-enter the password
2, the user configuration setting item
(1) view the user information
select host,user,plugin,authentication_string from mysql.user;
Note: host is% said they did not limit ip localhost indicates that this machine uses non mysql_native_password plugin you need to change your password
(2) modify the user password
ALTER USER 'root' @ '%' IDENTIFIED WITH mysql_native_password BY 'newpassword'; # update about the user's password for the root user password to newpassword
Third, the use navicat connect remote mysql
No configuration, for connection rejection
Even when mysql database error:
1251 client does not support authentication protocol requested by server;consider upgrading Mysql client
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
Be logged in mysql
mysql -u root -p
password
mysql> use mysql;
mysql> select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| admin | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| zhangj | localhost |
+------------------+-----------+
注意我的root,host是'%'
You may do is:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123';
改成:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123';