Centos solves mysql connection ERROR 1045 (28000)

Source: Internet
Author: User


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, therefore, execute this command in the current directory and then execute # mysql-u root mysql www.2cto.com with a blank password, log on to mysql and change the root Password mysql> UPDATE user set password = Password ('newpassword') where USER = 'root' and host = 'root' or host = 'localhos T'; next, change all empty user passwords to non-empty passwords. mysql> flush privileges; www.2cto.com, and 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>

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.