Quantcast
Channel: Restart MySQL server - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 5

Restart MySQL server

$
0
0

I am using MySQL v5.1 on Ubuntu machine.

MySQL on my machine used to work. (Running mysql -u root gave me the MySQL command line.)

This afternoon, I did the following thing:

1. check active process related to 'mysql' by run:

$ ps aux | grep 'mysql'
mysql  1457  3.3  1.3 130044 27076 ?        Ssl  16:22   0:43 /usr/sbin/mysql

2. I saw from above output the PID of the mysql process is 1457, so I killed it with:

$ sudo kill 1457

3. now, if I run $ mysql -u root , I get an error:

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

which is reasonable since I killed the process.

How can I have my MySQL server back up and running again after I killed it?

I tried to run sudo /etc/init.d/mysql start, but my MySQL server does not start. Why is that?


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images