0

ERROR 2002 (HY000): Can't connect to local MySQL server

I installed LAMP on Ubuntu and then set root password on phpMyAdmin. I forgot the password and now I am unable to login. When I try to change password through terminal I get this error.
How can I fix this? I am unable to open LAMP, uninstall it, or reinstall it.

mason
asked Dec 10, 2020
2 Answer
0

Make sure that you have installed the mysql-server, not the mysql-client or something else.
error means the file /var/run/mysqld/mysqld.sock doesn't exists
Hence
Install it using following command
sudo apt-get install mysql-server

But if the mysql-server is already installed and is running, then you need to check the config files.
The config files are:

The config files are:

/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf

Let the mysql use the /etc/my.cnf by renaming the /etc/mysql/my.cnf.
Then prob may solve.

View More
linuxhelp
answered Dec 10, 2020
0

Perhaps the best MySQL tool, with a GUI and IDE, can help you in this situation. You can use mysql gui for linux https://www.devart.com/dbforge/mysql/studio/ by dbForge Studio and it will help you with many tasks. And you can also optimize your daily workflow, and automate the management of database objects, and much more.

View More
sheenaowens
answered Feb 23, 2023
Your Answer
||||
 
100:0