Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MariaDB not allowing remote connections

enter image description here

enter image description here

As the screenshots show, I have the accounts setup to allow remote connections but as shown in the second screenshot I still cannot connect remotely.

like image 284
ItsJamie Avatar asked Feb 09 '14 19:02

ItsJamie


People also ask

Can't connect to MariaDB connection refused?

normally means that there is no MariaDB server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.


3 Answers

I use for testing in the virtual machine (Ubuntu 16.04), for me, I fixed the error changing the file 50-server.cnf.

My server is Ubuntu, so changing the file below:

50-server.cnf

The path of this file:

/etc/mysql/mariadb.conf.d

PS: Create a backup of the file before the change.

Only change in file the bind-address 127.0.0.0 to bind-address 0.0.0.0

After this restart service and try again.

Regarding that user, need to allow for external connections.

I hope that this info helps you.

like image 136
LandiLeite Avatar answered Sep 19 '22 15:09

LandiLeite


Mysql by default binds to 0.0.0.0 which is all interfaces on your system. Which means you can already connect from another computer. The issue is perhaps permissions. You can enable remote connections by running the following command:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.%' IDENTIFIED BY '' WITH GRANT OPTION;
like image 27
Fidel Avatar answered Sep 20 '22 15:09

Fidel


MariaDB packages bind MariaDB to 127.0.0.1 (the loopback IP address) by default as a security measure using the bind-address configuration directive. Old MySQL packages sometimes disabled TCP/IP networking altogether using the skip-networking directive.

Steps to allow remote connections are provided in the MariaDB Knowledge Base at https://mariadb.com/kb/en/mariadb/configuring-mariadb-for-remote-client-access/

like image 42
Joshua Avatar answered Sep 20 '22 15:09

Joshua