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