×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: bejoy balan
Added: Oct 8, 2014 5:26 AM
Views: 43
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

$ sudo service mysql stop
$ sudo /etc/init.d/apparmor reload
$ sudo service mysql start
  1. $ sudo service mysql stop
  2. $ sudo /etc/init.d/apparmor reload
  3. $ sudo service mysql START
  4.  
  5.  
  6.  
  7.  
  8. After checking that /etc/mysql/my.cnf was correct (port=3306, bind-address=127.0.0.1), I was still HAVING trouble. I THEN got /var/run/mysqld/mysqld.sock automatically BY installing mysql-server:
  9.  
  10. $ sudo apt-GET install mysql-server-5.5
  11. I THEN tried starting the mysql server AS thefourtheye said, but still got the same error you're getting when trying to start mysql via $ mysql -u root.
  12.  
  13. Finally, I found a similar discussion on ubuntu forums that finally fixed it for me.
  14.  
  15. Here's the ONLY part OF the link that I found I needed TO do:
  16.  
  17. $ sudo service mysql stop
  18. $ sudo /etc/init.d/apparmor reload
  19. $ sudo service mysql START
  20. THEN I was able TO START mysql WITH $ mysql -u root -p, USING the password I SET WHEN I installed mysql-server-5.5