symptom:
After installation of the mysql 8.0.11 can log on locally, but can not connect a remote third-party tools, firewalls have been put on,
The solution:
First, log into the mysql command line:
-u root -p mysql
1
after entering the select mysql database, user information exists in the user table in the library
MySQL use;
. 1
SELECT Host, User, authentication_string, from User plugin
. 1
can be seen, corresponding to the user is the host, localhost, not%, it can not be connected.
Approach:
1, authorized root users to remotely log in
. * * The ON the TO ALL the GRANT 'the root' @ '%';
. 1
2, the refresh permissions
privileges the flush;
. 1
. 3, modify the encrypted rules
The USER the ALTER 'root' @ 'localhost' the IDENTIFIED BY 'yourpassword' PASSWORD the EXPIRE NEVER;
. 1
. 4, the root password updating
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
1
5、刷新权限
PRIVILEGES the FLUSH;
. 1
test the connection. Navicat connection with the database can be properly connected.
Also, to the rights of ordinary users to connect remotely:
1, myuser authorized user of all tables specified library, all permissions and set up remote access
. GRANT ALL ON specified library the TO * 'myuser' @ '%';
. 1
2, update the user password
ALTER USER 'myuser'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
1
3.刷新权限
FLUSH PRIVILEGES;
---------------------