码迷,mamicode.com
首页 > 数据库 > 详细

Linux Ubuntu MySQL remote access 远程连接配置

时间:2016-10-29 11:43:17      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:my.cnf   lease   option   add   err   roo   instead   bsp   style   

For security consideration, mySQL does NOT allow remote access by default. 

You might see err: Can‘t connect to MySQL server on ‘xx.xx.xx.xx‘(10061)

Please check below configurations:

==========================

1. Listen to remote servers

vi /etc/mysql/my.cnf

# 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

comment out above line, or change to your remote server IP.

==========================

2. Create an account for remote access. (by default root account can only be used locally.)

# mysql -u root -proot 

mysql>GRANT ALL PRIVILEGES ON *.* TO ‘sa‘@‘%‘ IDENTIFIED BY ‘youpassword‘ WITH GRANT OPTION;

mysql>flush privileges;

# service mysql restart

 

Linux Ubuntu MySQL remote access 远程连接配置

标签:my.cnf   lease   option   add   err   roo   instead   bsp   style   

原文地址:http://www.cnblogs.com/anbosun/p/6010024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!