Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart mysql server? [closed]

Every time I restart MySQL server

bitnami@xxx:/$ sudo opt/bitnami/ctlscript.sh start server

 

WWarning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored
Warning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored
121120 12:30:18 mysqld_safe Logging to '/opt/bitnami/mysql/data/mysqld.log'.
121120 12:30:18 mysqld_safe Starting mysqld daemon with databases from /opt/bitnami/mysql/data
121120 12:30:20 mysqld_safe mysqld from pid file /opt/bitnami/mysql/data/ip-10-136-14-170.pid ended
/opt/bitnami/mysql/scripts/ctl.sh : mysql  could not be started

The server responds with the following error:

(2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")

Please tell me what I have to do fix this issue.

like image 421
Madhur Rampal Avatar asked Nov 20 '12 12:11

Madhur Rampal


People also ask

Why has my MySQL server stopped working?

MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. The solution varies depending on your version of MySQL.

How do I restart MySQL gracefully?

From another console window, restart MySQL the way you normally would, either with initscripts (e.g., your local variant of service mysql. server restart ) or with mysqladmin shutdown followed by a manual restart.


1 Answers

If mysql is installed as a service (which is most of the time) you can do service mysqld restart or /etc/init.d/mysqld restart.

You can also use start, stop or reload instead of restart.

like image 175
Martin Avatar answered Oct 18 '22 16:10

Martin