Marwa Dosoky
Marwa Dosoky

Reputation: 416

Cannot open MySQL for the first time

I have installed MySQL from Ubuntu software center, MySQL client and MySQL workbench as well.

the problem is I cannot do anything but to call sudo mysql start and sudo mysql stop

when i try to run the following command sudo /usr/bin/mysql_secure_installation i am prompted to enter the root password, i didn't set the root password so i just clicked 'Enter'

I got the following

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I went to /var/run/mysqld and i have found that it is completely empty.

Update

I don't know if that would help, but I have tried to find the PID file by using find / -type f -name "*.pid" command . I haven't found any files related to mysql with the extension .pid

Upvotes: 0

Views: 933

Answers (1)

Marwa Dosoky
Marwa Dosoky

Reputation: 416

I was removing the installation without sufficient commands, as it seems, finally i have removed it using the following :

#sudo service mysql stop  
#sudo killall -9 mysql
#sudo killall -9 mysqld
#sudo apt-get remove --purge mysql-server mysql-client mysql-common
#sudo apt-get autoremove
#sudo apt-get autoclean
#sudo deluser mysql
#sudo rm -rf /var/lib/mysql
#sudo apt-get purge mysql-server-core-5.5
#sudo apt-get purge mysql-client-core-5.5

This time i have removed the user as well. I didn't know that would matter. anyway after reinstalling it again it worked just fine

Upvotes: 1

Related Questions