Unable to connect to MariaDB remotely. Socket fail to connect to host on IP address, port
ID: 336
Category: MariaDB Database
Added: 16th of January 2023
Views: 1,706
If you are having trouble connecting to MariaDB remotely, then you need to check bind-address in the MariaDB configuration file.
The MariaDB configuration file can be found under the following directory /etc/mysql/mariadb.conf.d/50-server.cnf
To open and start editing the file using nano enter the following in the terminal
nano /etc/mysql/mariadb.conf.d/50-server.cnf
Scroll until you find bind-address = 127.0.0.1
Then comment out the line #bind-address = 127.0.0.1
Add a new line for bind-address and set this to bind-address = 0.0.0.0
Save the file by pressing ctrl + o and hit enter
Then exit nano by pressing ctrl + x
Then restart MariaDB
systemctl restart mariadb
Related Tips & Tutorials
➔ Unable to connect to MariaDB remotely, Host ip_address is not allowed to connect to MariaDB server