Mac install MySQL

Source: Internet
Author: User

1, install MySQL, install through homebrew

Brew Install MySQL

2. Set the password

Through the brew installed MySQL default is not set the password link, looked at the evening information, someone is set by/usr/local/etc/my.cnf not enter the password login,
I used a different method to initialize the password.

unset TEMDIRmysqld -initialize --verbose --user=root --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmpmysql.server startmysql_secure_installation    (abc123456.)

The password is in parentheses.

3. Reset Password
SHOW VARIABLES LIKE ‘validate_password%‘;SET GLOBAL validate_password_policy = ‘LOW‘;SET GLOBAL validate_password_length = 4;set password for ‘root‘@‘localhost‘=password(‘root’);  

In order to set a simple password, you need to reduce the default password security level.

4. Start and close MySQL

Start MySQL

mysql.server start

Turn off MySQL

mysql.server stop

Mac install MySQL

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.