Install MySQL database on Linux server (default installation, password is blank), need to change password for first use

Source: Internet
Author: User

1, add skip-grant-tables at the end of/ETC/MY.CNF, save, skip authentication.

2. Restart MySQL to make the configuration you just modified take effect.

3, terminal input MySQL, and then enter use MySQL;

4, terminal input Update mysql.user set Authentication_string=password (' 123456 ') where user= ' root ';

5, remove skip-grant-tables at the end of/etc/my.cnf, save.

6, restart MySQL, terminal input mysql-u root-p, and then follow the prompts to enter the password just set to normal use.

Description: The reason to change the password is because of an error in Access denied for user ' root ' @ ' localhost ', changing the password by password-free login, entering update mysql.user set Password=password (' 123456 ') where user= ' root ' When prompted Unknown column ' Password ' in ' Field List ', originally there is no password this field under the MySQL database, The password field is changed to authentication_string.

Install MySQL database on Linux server (default installation, password is blank), need to change password for first use

Related Article

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.