MySQL installation configuration on Mac

Source: Internet
Author: User

First, download the installation

Download the community version of DMG installation file: https://dev.mysql.com/downloads/mysql/

1, execute the installation files, follow the steps to complete the installation.

2, after the completion of installation terminal input:

-- version;

----Show the version number is normal, if the command not found, in the terminal input as follows, "/usr/local/mysql/bin/mysql" is the MySQL default installation path:

/usr/local/bin/-/usr/local/ MySQL/bin/MySQL MySQL

3. Turn off the MySQL service:

/usr/local/MySQL/support-files/mysql.server Stop

Second, the environment variable configuration

1, open The terminal, enter:

~

Will enter the ~ folder

2. then enter:

Touch. Bash_profile

After the carriage return is executed,

3. re-enter:

Open -E. bash_profile

This file is opened in TextEdit (this should be a blank document if the environment variable has not been previously configured). If you have content, enter it before the Terminator, and if there is no content, enter the following statement directly:

Export Path=${path}:/usr/local/mysql/bin

Then, save, Exit TextEdit(must be exited), close the terminal and exit.

Third, forget the root password reset

1. turn off the MySQL service (click Stop MySQL server) , System Preferences , Apple

2. Enter the terminal input:

/usr/local/mysql/bin/

Login Administrator rights after Enter

Enter the following command after carriage return to disable the MySQL authentication feature

. / -- Skip-grant-tables &

MySQL will restart automatically after carriage return ( the MySQL status in Preferences will become running)

3. Input command

. /MySQL

Enter the command after the carriage return

privileges;  

Enter the command after the carriage return

SET  for ' Root '@'localhost'= PASSWORD ('123'

At this end of the modification, after restarting the terminal, enter mysql-u root-p return and type the password:123 will start successfully.

Iv. deletion

Stop The MYSQL process and console enter the command .

1, sudo rm/Usr/Local/MySQL2, sudo rm-Rf/Usr/Local/Mysql*3, sudo rm-Rf/Library/Startupitems/mysqlcom4, sudo rm-Rf/Library/Preferencepanes/My*5Vim/etc/Hostconfig ( andRemoved the line mysqlcom=-YES-)6Rm-Rf~/Library/Preferencepanes/My*7, sudo rm-Rf/Library/Receipts/Mysql*8, sudo rm-Rf/Library/Receipts/Mysql*9, sudo rm-Rf/var/Db/Receipts/Com.mysql.*

MySQL installation configuration on Mac

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.