This is a read-only copy of the MariaDB Knowledgebase generated on 2024-05-19. For the latest, interactive version please visit https://mariadb.com/kb/.

Comments - Troubleshooting Connection Issues

3 weeks, 4 days ago Bob Hastings

Installing MariaDB (a.k.a. MySQL) for the first time on my desktop PC, I experienced a number of issues and followed quite a few false leads in attempting to solve them before finding that I needed to follow a few simple steps at installation time. To experts they may seem obvious, but the following may assist newbies like myself.

(1) Download and install both the mysql (or mariadb) package (the client) AND the mariadb-server package (the server)! In retrospect this seems obvious, but in my case the client and server run on the same machine, and I naively assumed that the mariadb package contained everything I needed to get up and running. Of course it doesn't, and invoking mysql produced an error message saying that the required connection socket did not exist.

(2) After installing the server, it needs to be started, otherwise you get the same socket error. For example on my Fedora Linux system:

sudo systemctl start mariadb.service

(3) Running MySQL as an ordinary user, it now starts, but returns a "Permission denied error", because users need to be GRANTed permission to access the databases. This is fixed by running MySQL as root and using the GRANT command, eg.:

GRANT ALL PRIVILEGES ON *.* to 'alexander'@'localhost';

I hope this is a help to somebody.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.