This article mainly introduces the installation tutorial of mysql5.7.18 under mac os10.12 in detail. It has certain reference value. Interested friends can refer to it.
Searched the entire network It's all kinds of pitfalls and it didn't solve my problem. Finally figured it out myself.
After installation, a temporary password will pop up, copy it. If you click too fast, you will still have another chance in the notification bar, and you will have to look at your hand to hit it. If the notification bar is gone, the fastest way is to reinstall it. (Uninstall it before reinstalling)
Then open the console and enter mysql. It will prompt command not found, then enter
alias mysql=/usr/local/mysql/bin/mysql alias mysqladmin=/usr/local/mysql/bin/mysqladmin
To create an alias, note that you need to re-run the above command after closing the terminal (you can save it to a bash file if you want it to be permanent)
Then enter mysqladmin -u root password *** ( ***Replace with temporary password)
Another error is reportederror: 'Access denied for user 'root'@'localhost' (using password: NO)'
A lot of Baidu requiresmac os to open the root user(Search for the opening method yourself)
Enter after openingsu root
Then enter the root password to enter root mode
Then enter mysqladmin -u root password *** (***Replace with temporary password )
The result is againcommand not found
Finally in root mode
##
sh-3.2# alias mysql=/usr/local/mysql/bin/mysql sh-3.2# alias mysqladmin=/usr/local/mysql/bin/mysqladmin sh-3.2# mysqladmin -u root -p password
Summary
After installing mysql, the system preferences start the serviceThen enterroot mode
sh-3.2# alias mysql=/usr/local/mysql/bin/mysql sh-3.2# alias mysqladmin=/usr/local/mysql/bin/mysqladmin sh-3.2# mysqladmin -u root -p password
The above is the detailed content of Mysql5.7.18 installation tutorial steps under mac os10.12. For more information, please follow other related articles on the PHP Chinese website!