允许MySQL中root账户的远程登录

1、root登录mysql之后,查看端口,确认是3306

show variables like ‘port‘;

2、添加root@%用户并设置密码为123456

GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";

如果出现这样的错误:

The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

解决方法:flush privileges;

 3、查看用户列表

use mysql;

select host,user,password from user;

 

Done!

 

允许MySQL中root账户的远程登录,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。