chao zhou
chao zhou

Reputation: 73

Mac mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'

Mac 10.10.1, Mysql 5.6.22

When I install mysql in my mac,and I write mysql -u root -p on the Terminal,it occur the error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

When I use Sequel PrO to connect the mysql,it occur the same error.

I try many method in stackoverflow,suck reset mysql password,and so on,it doesn't work

Any solution for this?

Upvotes: 3

Views: 14297

Answers (2)

Fatimah Alotaibi
Fatimah Alotaibi

Reputation: 11

MacOS Sierra blocks the sites that use system proxy settings, where all connections of localhost 127.0.0.1 are blocked. As a result, MySQL server does not work. To fix this problem, follow the instructions below.

  1. Select System Preferences... from the Apple  menu and click the Network app to launch it as shown below.
  2. Click your Wi­Fi connection to select it
  3. Click the Advanced... option
  4. Click the Proxies tab to select it
  5. Check the top 3 options Auto Proxy Discovery Automatic Proxy Configuration Web Proxy (HTTP)
  6. Click OK.
  7. Click Apply.
  8. Quit System Preferences.

if you are using Netbeans with it you should also do the following

  1. Launch NetBeans IDE.
  2. Select Preferences... form the NetBeans menu. 11. Click the General tab to select it .
  3. Select Use System Proxy Settings.
  4. Click Reload.
  5. Click Test connection.
  6. You must get the green checkmark, , indicating that the connection is successful.
  7. If the connection is successful, you can Clean & Build your applications in NetBeans IDE and Run them.

Upvotes: 1

puneet gupta
puneet gupta

Reputation: 383

Reset your password: -

/usr/local/opt/mysql/bin/mysqladmin -u root password 'new-password'

Then you can connect with actual credential.

Upvotes: 1

Related Questions