mysql时区设置

 

How Do I Restart MySQL Server?

by VIVEK GITE · 29 COMMENTS

Each distribution comes with a shell script (read as service) to restart / stop / start 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 / Ubuntu 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.

{ 29 comments… read them below or add one }

1 sharath  March 17, 2007 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

REPLY

2 Tim  May 28, 2007 at 4:19 am

try the other commands –

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

These usually work for me

REPLY

3 imp  July 12, 2007 at 5:53 pm

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

REPLY

4 mud  September 15, 2007 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

REPLY

5 Al  May 15, 2008 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 inhttp://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

REPLY

6 vivek  May 15, 2008 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

REPLY

7 Al  May 16, 2008 at 12:28 pm

Many thanx! :D

REPLY

8 Jack  May 26, 2008 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 :)

REPLY

9 yury  August 27, 2008 at 7:33 am

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

REPLY

10 Dom-2000  May 12, 2009 at 1:32 pm

You can also use:
# kill mysqld
.. wait till it shuts down – you can check by
# ps ax | grep mysql
then start it:
# cd /usr/local/mysql/bin (or where your mysql is installed)
# ./mysqld_safe &

REPLY

11 Rowena  May 25, 2009 at 2:23 am

For fedora, You must start mysqld everytime you boot up your pc, using /etc/init.d/mysqld start
If you stop without knowing it is starting it will show errors, you must start first, ok?

REPLY

12 Anonymous  February 27, 2010 at 2:29 pm

chkconfig –level 345 mysql on
will autostart mysql on fedora systems.

REPLY

13 mp3  August 2, 2009 at 4:39 am

Thanks a lot.

REPLY

14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值