Linux Ubuntu MySQL remote access 远程连接配置

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

 

posted @ 2016-10-29 09:49  palmydog  阅读(287)  评论(0编辑  收藏  举报