Mysql uninstallation and installation under Mac

Uninstall mysql under mac:

  1. Open the terminal terminal: enter the command:

mysql -u root -p

Then you will be prompted to enter the password of the mysql database, just enter it.

  1. Enter the code command at this time:

sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.

Then enter the password to delete the previously installed mysql on the Mac. At this time, you can enter the first command again: at this time, the terminal will display: command not found: mysql

ps: Another more intuitive way to check whether mysql has been successfully deleted: You can directly open the settings to see if the mysql icon in the last column has been deleted. If there is no mysql icon, it means that mysql has been successfully uninstalled.


Mysql installation steps under Mac:

  1. Click on the link: MySQL :: Download MySQL Community Server

Go to mysql download address

  1. Select the second macOS 13 (x86, 64-bit) download

  1. At this point, you have three options to choose: log in to your oracle account or register an oracle account to download. Here we can directly select the blue font at the bottom just start my download: download mysql directly for convenience.

  1. When installing Mysql after the download is complete, you may encounter a prompt that the installation is blocked. At this time, we need to click on the security and privacy in the settings:

Just enter your password and allow the installation.

  1. Then go to the next step to install mysql:

Remember to set the mysql password on this page, it is recommended not to be too complicated. Then the installation process is over~

At this time, click on your settings, and the mysql icon will appear in the last column~

Guess you like

Origin blog.csdn.net/m0_61908582/article/details/129292669