刘功瑞的博客

有一天你突然惊醒,发现这一切,都只不过是一场梦。

MySQL开启远程访问权限

登录MySQL

mysql -u root -p


查询用户表

use mysql;

select  User,authentication_string,Host from user;



这里可以看出host默认都是localhost访问权限。


下一步:


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

%代表所有主机,也可以具体到你的主机ip地址,123456表示远程连接的密码


flush privileges;  

必须执行这一步,表示从mysql数据库的grant表中重新加载权限数据


最后重新查询user表:


select  User,authentication_string,Host from user;






发表评论:

Powered By Z-BlogPHP 1.5.2 Zero

Copyright www.liugongrui.com.All Rights Reserved.