Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | None |
Time | 1m |
# vi /etc/rc.conf
Append / modify following line to start MySQL service:
mysql_enable="YES"
Save and close the file.
Task: Start MySQL server on FreeBSD
Type the following command:
# /usr/local/etc/rc.d/mysql-server start
Task: Stop MySQL server on FreeBSD
Type the following command:
# /usr/local/etc/rc.d/mysql-server stop
Task: Restart MySQL server on FreeBSD
Type the following command:
# /usr/local/etc/rc.d/mysql-server stop && /usr/local/etc/rc.d/mysql-server start
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 11 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
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 !
/usr/local/etc/rc.d/mysql-server restart
If you don’t like starting mysql from /usr/local/etc/rc.d/ and service won’t work like this :
# service mysql status
mysql does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d)
You can make symlink
ln -s /usr/local/etc/rc.d/mysql-server mysql
This way you can use
# service mysql status
mysql is running as pid 5023.
# service mysql restart
Stopping mysql.
Waiting for PIDS: 5023.
Starting mysql.
Assuming you are in /etc/rc.d