Install and configure MySQL under Mac

Source: Internet
Author: User

1. Download the end of the. DMG MySQL installation package

mysql:http://dev.mysql.com/downloads/mysql/

installation process, there will be a pop-up window prompt, Note: XXX location is your initial login password

2016-08-17t15:58:04.890314z 1 [Note] A temporary password is generated for [email protected]: XXX

If you lose this password, please consult the sections how to Reset the Root password in the MySQL reference manual.

2, after the installation is complete, set the system variables,

Vim/etc/profile

Export path= $PATH:/usr/local/mysql/bin/

3. Turn on the computer-"system Preferences-" Start MySQL Server

Start the service

4, after the discovery login, query command input useless,

ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.

bash-3.2# Mysql-u Root-p

Enter Password: XXX (initial login password)

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

bash-3.2# Mysql-u Root-p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 2538

Server version:5.7.14

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> show databases;

ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.

Mysql> Select Version (), current_date;

ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.

5, so you must reset the login password

mysql> Set PASSWORD = PASSWORD (' Password set by yourself ');
Query OK, 0 rows affected, 1 warning (0.03 sec)

Mysql> ALTER USER ' root ' @ ' localhost ' PASSWORD EXPIRE never;
Query OK, 0 rows affected (0.03 sec)

mysql> flush Privileges;
Query OK, 0 rows affected (0.03 sec)

 

  

Install and configure MySQL under 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.