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)