Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Server does not start on Raspberry Pi [closed]

I am working with a Raspberry Pi running Debian Linux. I am trying to install MySQL Server and run it and here is what I have done:

# sudo apt-get install mysql-server mysql-client php5-mysql

No errors. Now I rebooted the system, then when starting up I get:

[FAIL] startpar: service(s) returned failure: mysql ... failed!

And I tried

# sudo service mysql start
mysql: unrecognized service

Lastly I tried

# /etc/init.d; mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I find that I have no folder named mysqld in /var/run. But I read that the sock file here shall be created the first time the server is created?

Do you have any suggestions?

like image 334
Furedal Avatar asked Apr 23 '13 14:04

Furedal


2 Answers

Looks like your mysql server is not started. I usually run the stop command and then start it again:

mysqld stop
mysql.server start

Same error, and this works for me.

like image 136
jesuis Avatar answered Sep 21 '22 08:09

jesuis


/etc/init.d; mysql

The usual way to start the mysql server would be

/etc/init.d/mysqld start

The reason it's failing should be written to the logs (usually /var/log/mysqld.log) - what do the logs say?

like image 23
symcbean Avatar answered Sep 21 '22 08:09

symcbean