ERROR 1820 (HY000): You must set password befo

Source: Internet
Author: User

ERROR 1820 (HY000) occurs during mysql installation: You must set password before executing this statement solves the problem that the newly installed mysql always has an ERROR prompt when it enters the mysql tool: # mysql-u root-pEnter password: ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO) or # mysql-u root-p password 'newpassword' Enter password: mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user' root' @ 'localhost' (using Password: YES) 'Now the solution is finally found. It was originally prepared to be reinstalled. It is no longer necessary. The method is simple, as follows: #/etc/init. d/mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysqlmysql> UPDATE user SET Password = PASSWORD ('newpassword ') where USER = 'root' and host = 'root' or host = 'localhost'; // you can change all empty USER passwords to non-empty passwords. Mysql> flush privileges; mysql> quit #/etc/init. d/mysqld restart # mysql-uroot-pEnter password: <enter the new password newpassword> MySql5.6, and an error is returned: you must set password before executing this statement solves mysql> set password = PASSWORD ('000000'); Query OK, 0 rows affected (123456 sec) mysql> create database roger; Query OK, 1 row affected (0.00 sec), that is, use mysql> set password = PASSWORD ('000000'); reset the PASSWORD again!

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.