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:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 8 comments… read them below or add one }
Thank you. i need this command.
God tip.
Thanks!
pls. i need more about mySQL method of setting and resetting
Appreciated.
As always, phenomenal tips from nixcraft. Every single problem I have ever had with freeBSD this site has solved! 5/5
Very useful info. Could you please tell me how to configure the MySQL server to work with PHP. I have just installed and started.
I had to add the following to /etc/rc.conf for this to work:
Cool! It runned cool for me !