Install MySQL 5.7.10 on Mac OS X

Source: Internet
Author: User

Install MySQL 5.7.10 on Mac OS X

I tried to install MySQL on the Mac over the past two days. I didn't expect the simple action that I thought would have wasted so much time. I wrote it here. It's a mark, to save some detours for later students.

At first, I used mac as linux, so I planned to install it on the command line. So I installed brew and then installed mysql through brew, as a result, I couldn't start it any time. I thought of countless ways and couldn't find the reason. I finally gave up the solution. Because the problem is not solved, we will not waste words here.

Plan B downloads dmg installation from the official website: I am the download link

After the installation is complete, start the mysql service in the system preference settings, and start the command line to reset the root password. I did not expect this step to be difficult for me all afternoon, in any case, you cannot connect to the mysql service. Later I learned that mysql5.7.9 and later will not use the original default password method, but will randomly generate a default password during installation and send it to the user in the system prompt. I was so stupid that I cried. Every time I heard a prompt, I ignored it. The password was quietly lying here, but I never knew it:

Because I have already reinstalled it N times, the password has expired because it overwrites the installation, I don't know why (I still called Apple's customer service in my innocence). The system only sent a prompt but didn't notify me. You must uninstall it first and reinstall it to work properly. The uninstall method is as follows:

Sudo rm/usr/local/mysql
Sudo rm-rf/usr/local/mysql *
Sudo rm-rf/Library/StartupItems/MySQLCOM
Sudo rm-rf/Library/PreferencePanes/My *
Vim/etc/hostconfig (and removed the line MYSQLCOM =-YES -)
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 reinstall it. After the installation is successful, log on with the temporary password: Enter the command, mysqladmin-u root-p password, and you will be reminded to enter the password. After the temporary password is successfully entered, you will be reminded to change the password. After the change, you will be able to log on normally.

When I saw the mysql> interface, I was crying.

This article permanently updates the link address:

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.