Troubleshooting Connection Issues Guide
Diagnose and fix common MariaDB Server connection problems, such as "Can't connect to local server" and access-denied errors, with step-by-step troubleshooting.
Server Not Running or Incorrect Location
Symptoms
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")mariadb -u someuser -p --port=3307 --protocol=tcp
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost'
(111 "Connection refused")Causes & Solutions
Server Not Running
$ mariadb-admin status
mariadb-admin: connect to server at 'localhost' failed
error: 'Can't connect to local server through socket '/tmp/mysql.sock' (2)'
Check that mariadbd is running and that the socket: '/tmp/mysql.sock' exists!Incorrect Parameters
Unable to Connect from a Remote Location
Symptoms
Causes & Solutions
Authentication Problems
Symptoms
Causes & Solutions
Problems Exporting Query Results or Loading Data
Symptoms
Causes & Solutions
Access Denied to a Specific Database
Symptoms
Causes & Solutions
Issues Due to Option Files or Environment Variables
Symptoms
Causes & Solutions
Unable to Connect / Lost Root Password
Symptoms
Causes & Solutions
Quick Fix: Access Denied for 'root'@'localhost'?
localhost vs. % Wildcard Host Issues
Symptoms
Causes & Solutions
MariaDB Authentication Tutorial
See Also
Last updated
Was this helpful?

