TransWikia.com

MySQL Installation: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Database Administrators Asked by rdrgtec on January 25, 2021

Tried to install MySQL on Ubuntu, with these 3 commands:

sudo apt update
sudo apt install mysql-server
mysql_secure_installation

When running the last command, it asks for the password for the root account. After I enter it, I got the following error:

Securing the MySQL server deployment.

Enter password for user root:
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have checked and apparently there is no mysqld.sock file anywhere.

Is there anything else I should run that I haven’t yet?

One Answer

I know there are a lot of descriptions about this error on the internet, but there seems to be many causes for that, and all of them seems linked to installation.

In my case, I found out my "sudo" access had some issues. After I've corrected them, I've uninstalled everything and installed again, and everything seems to work fine now.

Correct answer by rdrgtec on January 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP