Linux下允许MySQL 授权远程连接

1、mysql -u root -p   (root)用户名

2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

3、mysql>flush privileges;

4、如果此时还无法连接,检测配置文件(/etc/mysql/mysql.conf.d/mysqld.cnf) bind-address配置是否开启,应该是关闭

#bind-address = 127.0.0.1 注释掉;

 

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1                    <----这个
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8

 

5、重启mysql:/etc/init.d/mysql restart;

posted on 2018-04-13 14:37  亲爱的伟哥哥  阅读(6264)  评论(0编辑  收藏  举报