FreeBSD start / stop / restart MySQL Server

by Vivek Gite on October 9, 2007 · 8 comments

Q. I'm using FreeBSD server version 6.2. How do I start / stop MySQL server from a shell prompt over ssh session?

A. First login as the root user. Next make sure MySQL service is enabled. Just open /etc/rc.conf file using vi text editor:
# vi /etc/rc.conf

Append / modify following line to start MySQL service:
mysql_enable="YES"

Save and close the file.

Task: Start MySQL server

Type the following command:
# /usr/local/etc/rc.d/mysql-server start

Task: Stop MySQL server

Type the following command:
# /usr/local/etc/rc.d/mysql-server stop

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 8 comments… read them below or add one }

1 chat October 3, 2008

Thank you. i need this command.

Reply

2 GB June 25, 2009

God tip.
Thanks!

Reply

3 KAZEEM ADEDOKUN July 30, 2009

pls. i need more about mySQL method of setting and resetting

Reply

4 Beginner August 20, 2009

Appreciated.

Reply

5 Vorbis January 27, 2010

As always, phenomenal tips from nixcraft. Every single problem I have ever had with freeBSD this site has solved! 5/5

Reply

6 Linux techie May 18, 2010

Very useful info. Could you please tell me how to configure the MySQL server to work with PHP. I have just installed and started.

Reply

7 Rob November 22, 2011

I had to add the following to /etc/rc.conf for this to work:

mysql_enable=”YES”
mysql_args=”–user=mysql”

Reply

8 informatty January 30, 2012

Cool! It runned cool for me !

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 15 + 13 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: