Mysql installation error ERROR1820 (HY000): YoumustSETPASS_MySQL

Source: Internet
Author: User
Mysql installation error ERROR1820 (HY000): YoumustSETPASSWORDbeforeexecutingthisstatement solves bitsCN.com

ERROR 1820 (HY000): You must set password before executing this statement solved during mysql installation

The newly installed mysql always has the following error message when entering the mysql tool:

# Mysql-u root-p

Enter 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' failed

Error: 'Access denied for user' root' @ 'localhost' (using password: YES )'

Now we have finally found a solution. It was originally prepared to be reinstalled. it is no longer necessary.

The procedure is as follows:

#/Etc/init. d/mysql stop

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

# Mysql-u root mysql

Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root' and host = 'root' or host = 'localhost '; // change all empty user passwords to non-empty ones.

Mysql> flush privileges;

Mysql> quit #/etc/init. d/mysqld restart

# Mysql-uroot-p

Enter password: <输入新设的密码newpassword>

MySql5.6 operation error: You must set password before executing this statement solved

Mysql> set password = PASSWORD ('20140901 ');

Query OK, 0 rows affected (0.03 sec)

Mysql> create database roger;

Query OK, 1 row affected (0.00 sec)

That is, use mysql> set password = PASSWORD ('123'); in this case, reset the PASSWORD!

BitsCN.com
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.