2

mysqld don't start, as there are no process, and no logs.

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

Running mysqld start (as root)

151025 14:52:07 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead. 151025 14:52:07 [Note] mysqld (mysqld 5.5.44-0ubuntu0.14.04.1) starting as process 1652 ...

And with --verbose it's return the same.

Of course, I check the logs, but there are no logs.

Thanks

1 Answer 1

5

Here are some of the solutions for this problem.

Maybe /var/run/mysql/mysql.sock is missing. If /var/run/mysql/mysql.sock is missing you can replace it by doing the following:

sudo touch /var/run/mysql/mysql.sock
sudo chown mysql /var/run/mysql/mysql.sock

If this doesn't help you can try and reinstall it.

First remove it:

sudo apt-get --purge remove mysql-server
sudo apt-get --purge remove mysql-client
sudo apt-get --purge remove mysql-common

sudo apt-get autoremove
sudo apt-get autoclean

Also remove MySQL dir:

sudo rm -rf /etc/mysql

And then install it:

sudo apt-get install mysql-server mysql-client

After that you can check status:

sudo service mysql status

Workaround if AppArmor is the problem:

sudo aa-complain /etc/apparmor.d/*mysql*

And also check if there is enough drive space.

16
  • Hope this helps.
    – user401658
    Oct 25, 2015 at 21:30
  • Hi, Thanks for your answer. However, if I delete my DB, I will lost all files. Oct 26, 2015 at 17:28
  • You can also try mysql.server start if your server is not running.
    – user401658
    Oct 26, 2015 at 21:45
  • Or maybe you need to install mysql-server if you installed mysql-client only.
    – user401658
    Oct 26, 2015 at 21:48
  • Keep trying and give me feedback on your process because this problem can be solved in many ways and some of these solutions must work for you.
    – user401658
    Oct 26, 2015 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .