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?
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.
/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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With