Life is short, enjoy every movement (TM)
Random header image... Refresh for more!

How Do I Restart MySQL Server?

Each distribution comes with shell script (read as service) to restart mysql server. First login as root user and open shell prompt (command prompt).

First login as root user. Now type the following command as per your Linux distro:

A) If you are using mysql on RedHat Linux (Fedora Core/Cent OS) then use following command:

* To start mysql server:
# /etc/init.d/mysqld start

* To stop mysql server:
# /etc/init.d/mysqld stop

* To restart mysql server
# /etc/init.d/mysqld restart

Tip: Redhat Linux also supports service command, which can be use to start, restart, stop any service:
# service mysqld start
# service mysqld stop
# service mysqld restart

(B) If you are using mysql on Debian Linux then use following command:

* To start mysql server:
# /etc/init.d/mysql start

* To stop mysql server:
# /etc/init.d/mysql stop

* To restart mysql server
# /etc/init.d/mysql restart

More MySQL articles are here and here.

Related posts (skip to comment)

9 comments

1 sharath { 03.17.07 at 10:59 am }

hi
i am new to linux and i have to stop the mysqld service so as to install bugzilla … i have tried the following cmds but they have failed
/etc/init.d/mysqld stop
i am using redhat os

2 Tim { 05.28.07 at 4:19 am }

try the other commands -

# service mysqld start
# service mysqld stop
# service mysqld restart

These usually work for me

3 imp { 07.12.07 at 5:53 pm }

Thanks a lot for this! I really helped me out.

4 mud { 09.15.07 at 3:20 am }

hi
iam using centos 5.0 and ihave problem with mysql
mysql cant connect
i have try to restart n all command which u show on your web but its unsuccesfull
can tell me why..?n what can i do to get mysql back like before
thanks

5 Al { 05.15.08 at 8:47 am }

Hi,
I’m really embarrased to ask this, but I’m really new to linux + mysql. I installed mysql following the proceadure in http://dev.mysql.com/doc/refman/5.0/en/installing-binary.html, then I try to run your restart command and I get: -bash: /etc/init.d/mysql: No such file or directory.
I’m using mysql 5.0 over Debian… I’m sure I missed some configuration little detail, what can it be?
Any response is well appreciated :)
Al

6 vivek { 05.15.08 at 11:04 am }

mysqld_safe is the recommended way to start a mysqld server if you install it from source or mysql.com:
mysqld_safe &

The correct method to install it via apt-get under Debian and Ubuntu Linux. Type the following to install
apt-get install mysql-server-5.0 mysql-client-5.0
Type the following to start:
/etc/init.d/mysql start

7 Al { 05.16.08 at 12:28 pm }

Many thanx! :D

8 Jack { 05.26.08 at 1:24 pm }

Hi thanks for this site, I sometimes have to restart the mysqld server myself, when it hangs. So this is really helpful, best result on google :)

9 yury { 08.27.08 at 7:33 am }

What’s about Darwin with the ‘launchd’ installed? How do I restart mysql?

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , , ,