1.开放防火墙 3306端口,重启防火墙
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save#保存
service iptables restart
2.添加root 远程权限
mysql -h localhost -P3306 -u root -p ******
use mysql
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'php' WITH GRANT OPTION;
flush privileges;#重启权限规则
3.重启mysql
service mysql restart
ps. 注意有的直接update mysql.user表,需要重新update Password=password('mysql'),再flush生效。
相关文章:
,请先登录查看所有评论- 补充 MySQl 查询 count(*) count(1) count(主键) 怎样选择索引的 2017-06-14
- MySQl 查询 count(*) count(1) count(主键) 选哪个 2017-06-14
- mysql基础再回顾 2016-12-15
- MySQL错误之‘Got a packet bigger than 'max_allowed_packet' bytes’ 2016-01-13
- Navicat 操作数据库传输 2015-09-29
网友评论已关闭