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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 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 !