Remote connection to MySQL server?

I try to configure MySql 5.5 server for remote access from the Ubuntu node 192.168.1.139, so I added the line: bind-address = 192.168.1.139 to the server configuration file: /etc/mysql/my.cf When I tried to restart mysqld, I had following error:

[Note] Server hostname (bind-address): '192.168.1.139'; port: 3306 [Note] - '192.168.1.139' resolves to '192.168.1.139'; [Note] Server socket created on IP: '192.168.1.139'. [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address [ERROR] Do you already have another mysqld server running on port: 3306 ? 

Can someone help with the cause of the problem? And how can I open a MySQL server to connect from any host / user, for example. What should be the syntax for my.cf?

+6
source share
2 answers

bind-address is for local IP addresses or network interfaces. You cannot bind to a remote address. To make such restrictions, you need to configure the rules in the firewall. Run ifconfig to find out what network interfaces you have. Use

 bind-address = 0.0.0.0 

to allow connections to any interface. I recommend you this post https://serverfault.com/a/139326

+8
source

I think this post

 [ERROR] Do you already have another mysqld server running on port: 3306 ? 

can be quite wrong, as it could also be related to the binding address, not the itel port.

In my case, the database did not start in system init, because I was bound to the IP address 10.0.0.11, whose interface was not ready at startup. To solve this problem (on MariaDB / Fedora 24):

 mkdir /lib/systemd/system/mariadb.service.d echo "[Unit] After=network-online.target Wants=network-online.target " > /lib/systemd/system/mariadb.service.d/waitForNetwork.conf 
+2
source

Source: https://habr.com/ru/post/954286/


All Articles