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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM