Fork me on GitHub

将 MySQL root 的远程访问密码由空密码改为 password

命令依次如下:

mysql -u root -p
use mysql;
select host,user,password from user;
grant all privileges  on *.* to root@'%' identified by "password";
flush privileges;
select host,user,password from user;

 

之后就可以用 MySQL 的客户端工具(如:Navicat)远程访问了,

数据库连接的用户名和密码为:root/password

posted @ 2020-07-17 11:06  龙凌云端  阅读(370)  评论(0编辑  收藏  举报