Upgrade to MacOS 10.12 mysqlb error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

Source: Internet
Author: User
Tags mysql in

After the system upgrade to MacOS 10.12 after starting MySQL, the terminal input MySQL error
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using password:yes/no)

Solutions
1Turn off MySQL in System Preferences
2$Cd/usr/bin
3$sudo mysqld_safe--skip-grant-tables
4Open a terminal again
$MySQL
Mysql>Use MySQL;
Mysql>UPDATE user SET Password=password (' 123456 ') WHERE user = ' root ';
OrUPDATE mysql.user SET password=password (' 123456 ') WHERE user= ' root ';
If your MySQL version is greater than 5.7 (can be entered in the terminal command:MySQL--versionView MySQL version number)
Enter this command:
UPDATE mysql.user SET authentication_string=password (' 123456 ') WHERE user= ' root ';
Last mysql>exit;

Start MySQL in System Preferences .

Reference Documentation:

http://stackoverflow.com/questions/13480170/access-denied-for-mysql-error-1045

Http://stackoverflow.com/questions/489119/mysql-error-1045-access-denied?rq=1

Upgrade to MacOS 10.12 mysqlb error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

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.