Tag Archives: mysql error 1045

MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)

Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)

This prompt is a password error. If you forget your password, you can use this method to reset your password
* * 1. * * the first step to reset your password is to skip the password authentication process of MySQL
modify the MySQL configuration file
and find it in the directory of C:// program files/MySQL/MySQL server 5.7 my.cnf/my .ini/my- default.ini One of the three is modified
in [mysqld] skip-grant-tables

**2 * * restart MySQL service

	net start mysql

If this command reports an error and cannot start MySQL service, run it as an administrator cmd.exe ( cmd.exe In the directory of C: Windows: system32

**3. * * implementation again

	mysql -u root -p

You don’t need to enter a password. Press enter to enter mysql

**4 * * Change Password

	update user set Password=PASSWORD('888888') where User='root'; 
	FLUSH PRIVILEGES;

Use 888888 to login next time

5. If 4 reports error 1820 (HY000): you must set password before executing this statement, execute the code

 	SET PASSWORD = PASSWORD('123456');
	or SET PASSWORD = '123456';

Then prompt query OK, 0 rows affected (0.00 sec)
and you can log in with 123456 password

After installing mysql5.7 on centos7, an error 1045 (28000) is reported: access denied for user ‘root’ @’localhost ‘(using PAS)

After installing mysql, there will be a temporary password to check the log, but it still doesn’t work after checking the login modification secret
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password:yes)
so
1. Stop mysql service

systemctl stop mysqld.service

2, modify the profile to log in without password

[HTML] view plain copy

    1. vi/etc/my CNF </ ol>

Add it at the end

[HTML] view plain copy

      1. skip – grant – tables </ ol>
      1. save

3. Start mysql

[HTML] view plain copy

        1. systemctl start mysqld. Service </ ol>
        1. 4, log in musql

[HTML] view plain copy

          1. mysql -u root </ ol>
          1. Be careful not to add minus p here

5, modify the password, mySQL5.7 use this syntax

[HTML] view plain copy
The

            1. use mysql; </ ol>

[HTML] view plain copy

              1. update mysql.user set authentication_string=password(‘123456′) where user=’root’; </ ol>
              1. 6, go back to the second step remove the plus

[HTML] view plain copy

                1. skip – grant – tables </ ol>
                1. Save and restart mysql

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
In fact, after installing mysql by default or in the log to generate a default password /var/log/mysqld.log
Login to mysql to reset the default password

[HTML] view plain copy

                  1. set password = password (‘ you password “); </ ol>

If the password level does not match the default level requirement, it will be reported

[HTML] view plain copy

                    1. Your password does not satisfy the current policy requirements

You need to change the level and the minimum default password number

[HTML] view plain copy
The

                    1. set global validate_password_policy = 0; The set global validate_password_length = 4; </ ol>
                    1. And then just set the password

# # # # # # # # # # # # # # # # # # #
Error 1130 on remote connection

[HTML] view plain copy

                    1. mysql; The use of mysql; Mysql; Select ‘host’ from user where user=’root’; Mysql; Update user set host =’ %’ where user =’root’; Mysql; Flush privileges; Mysql; Select ‘host’ from user where user=’root’; </ ol>