MYSQL ERROR 1045 (28000): Access denied for user (using Password:yes)

Source: Internet
Author: User

After installing MySQL, some users want both local and remote access.

Mysql-h Host-uroot-ppassword Error occurred:

MYSQL ERROR 1045 (28000): Access denied for user (using Password:yes)

This is because you do not have access to MySQL, your host is not stored in the MySQL user table, or the username or password is incorrect.

1. Skip authorization and go to MySQL:

Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &

2. Give sufficient privileges

Grant all privileges on * * to ' root ' @ '% ' with GRANT option;

Import permissions into memory without restarting MySQL to see if permissions are executed correctly

flush privileges;

3. Reconfigure user passwords

>use MySQL

>update user SET Password=password (' NewPassword ') where user= ' root ';

4.sudo Service MySQL Restart

Success. This allows the database to be accessed from the intranet and from the extranet.

Report:

If the user table does not have a record, it must be added manually:

INSERT into user (host, user, password, select_priv, Insert_priv, Update_priv) VALUES (' localhost ', ' username ', password (' YourPassword '), ' y ', ' y ', ' y ');

Note the records in/ETC/MYSQL/MY.CNF

Bind-address =127.0.0.1

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MYSQL ERROR 1045 (28000): Access denied for user (using Password:yes)

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.