1 頁 (共 1 頁)

stop mysql

發表於 : 2018-07-09 10:53:08
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

uninstall mysql

發表於 : 2018-07-09 11:02:34
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

Re: stop mysql

發表於 : 2018-07-09 11:05:18
yehlu

代碼: 選擇全部

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