In the CentOS environment login MySQL report ERROR 1045 (28000) How to solve
New to start a virtual machine, CENTOS7 series of operating systems, after installing MySQL, perform a connection with MySQL error 1045 (28000): error. If you encounter the same problem, you can refer to the following workaround.
Tools/Materials
Method/Step
First use the following command to stop the MySQL or mariadb service.
Service MARIADB Stop
Use Mysqld_safe to start the MYSQLD server:
Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
Log back in to the database again and execute the following command:
Mysql-uroot MySQL
Reset the root password and refresh permissions. In the following SQL statements, 123456 is the root password to be modified and can be modified to suit your needs.
UPDATE user SET Password=password (' 123456 ') where user= ' root '; FLUSH privileges;
Log in again, you can log in successfully.
Mysql-uroot
In the CentOS environment login MySQL report ERROR 1045 (28000) How to solve