stop mysql

Apple OS
回覆文章
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

stop mysql

文章 yehlu »

https://stackoverflow.com/questions/100 ... os-install

代碼: 選擇全部

mysqladmin shutdown -u root -p

There are different cases depending on whether you installed MySQL with the official binary installer, using MacPorts, or using Homebrew:

MacPorts
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql.plist
Note: this is persistent after reboot.

Homebrew
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Binary installer
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

uninstall mysql

文章 yehlu »

https://coolestguidesontheplanet.com/re ... mand-line/

To remove an instance of MySQL from your macOS or OSX installation you need to delete a number of files via the command line, but first ensure that you have database dumps of your databases and that then the database server is not running.

Back Up any needed databases
All of them

mysqldump --all-databases > all_databases_export.sql
Or individually

mysqldump database_name > database_exportname.sql
Stop the database server
>= MySQL 5.7

sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
< MySQL 5.7

sudo /usr/local/mysql/support-files/mysql.server stop


Remove MySQL
sudo rm -rf /usr/local/mysq*
sudo rm /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
Edit /etc/hostconfig and remove the line MYSQLCOM=

rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
That’s it MySQL is now totally removed from your system
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: stop mysql

文章 yehlu »

代碼: 選擇全部

brew install mysql-client
​​​​​​​echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
回覆文章

回到「Mac OS X」