Linux Ubuntu MySQL remote access 远程连接配置

Posted palmydog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于Linux Ubuntu MySQL remote access 远程连接配置的主要内容,如果未能解决你的问题,请参考以下文章

Mysql远程连接失败

vscode远程ubuntu代码编辑

MicroPython Remote Shell

linux执行mount命令报错:mount: RPC: Remote system error - Connection refused(NFS:nfs-kernel-server 挂载教程)

如何正确安装 csdtoolbox-remote?

ubuntu小技巧8——linux(ubuntu)下mysql安装问题