In the CentOS environment login MySQL report ERROR 1045 (28000) How to solve

Source: Internet
Author: User

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
    • Centos
    • MySQL, mariadb
Method/Step
    1. First use the following command to stop the MySQL or mariadb service.

      Service MARIADB Stop

    2. Use Mysqld_safe to start the MYSQLD server:

      Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &

    3. Log back in to the database again and execute the following command:

      Mysql-uroot MySQL

    4. 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;

    5. Log in again, you can log in successfully.

      Mysql-uroot

In the CentOS environment login MySQL report ERROR 1045 (28000) How to solve

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.