0

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

Ahmad Alfy
  • 13,107
  • 6
  • 65
  • 99
Marwa Dosoky
  • 406
  • 7
  • 19
  • Are you sure you installed your MySQL? – Mark Dec 09 '14 at 08:20
  • try:http://stackoverflow.com/questions/16556497/how-to-reset-or-change-the-mysql-root-password/16556534#16556534 – Mark Dec 09 '14 at 08:21
  • yes and when i run the command **service mysql status ** it returns >> mysql start/post-start, process 14029 post-start process 14030 – Marwa Dosoky Dec 09 '14 at 08:22
  • Try to change or reset your root password on MySQL. Try my link above – Mark Dec 09 '14 at 08:22
  • I have followed the instructions in there . in the second command ** sudo mysqld --skip-grant-tables &** I got the following 141209 10:23:43 [ERROR] Can't read from messagefile '/usr/share/mysql/english/errmsg.sys' @ChristianMark I tried to open the file but i got a message saying wrong formate ! – Marwa Dosoky Dec 09 '14 at 08:25
  • check http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run and http://stackoverflow.com/questions/19658891/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run – john Dec 09 '14 at 09:55
  • @Maged I did. The problem there was they didn't start the server or the socket file is misplaced. in my case , there is no socket file fourn related to mysql from the begining – Marwa Dosoky Dec 09 '14 at 09:59

1 Answers1

1

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

Marwa Dosoky
  • 406
  • 7
  • 19