MySQL cannot log on after installation is complete.

Source: Internet
Author: User

MySQL database with RPM package after installation, a series of problems, the following will start to answer

1. After the installation is complete, service MySQL start, normal start

Use MySQL or mysql-u root-p to enter directly, the following error is reported

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

The solution is as follows:

Service MySQL stop mysqld_safe--user=mysql--skip-grant-tables--skip-networking & mysql-u root-p Direct Carriage Enter EXECUTE statement use MySQL UPDATE user SET Password=password (' Your_newpassword ') where user= ' root '; Flush privileges; Quit service MySQL start mysql-u root-p Enter the password you just modified to enter

2. The above problem is solved, then the problem comes again, after landing to look at the database bar,

show databases;

Results:!!

ERROR 1820 (HY000): Must SET PASSWORD before executing this statement

The solution is as follows:

SET PASSWORD = PASSWORD (' Your_newpassword '); Get the return value to OK and try again, show databases; you'll find it normal.


MySQL cannot log on after installation is complete.

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.