Solve mysql connection error in centos: ERROR1045 (28000) CentOS
BitsCN.com
Centos solves mysql connection ERROR 1045 (28000) first stop mysql service # service mysql stop next execute # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & but if no environment variable is configured, the system prompts that the mysqld_safe command cannot be found. Therefore, you can only find the mysql installation directory and enter the bin directory. the command is in the current directory, so execute this command in the current directory and then execute # mysql-u root mysql Password is blank. log on to mysql and change the root PASSWORD mysql> UPDATE user SET Password = PASSWORD ('newpassword ') where USER = 'root' and host = 'root' or host = 'localhost '; The password is changed to a non-empty mysql> flush privileges; exit mysql. Mysql> quit restart mysql service # service mysql restart log on to mysql with a new password # mysql-uroot-p Enter password: <Enter the new password newpassword> BitsCN.com