Mysql password cannot be changed processing scheme
The main purpose of this article is to tell you briefly that the mysql password cannot be changed. You can collect relevant professional terms online or find some professional books to supplement them. We will not dabble here and go straight to the topic. I hope we can bring you some practical help.
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
Today in the MySql5.7 operation Times error: You must SET PASSWORD before executing this statement solution, friends in need can refer to
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
Mysql > create database yan1
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
Mysql > SET PASSWORD = PASSWORD ('123456')
Query OK, 0 rows affected (0.03 sec)
Mysql > create database yan1
Query OK, 1 row affected (0.00 sec)
That is to say, use mysql > SET PASSWORD = PASSWORD ('123456'); reset the password again! Damn it, it takes a lot of effort.
This guy has the same problem.
Recently newly installed mysql always has an error 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 the solution has finally been found. I was going to reinstall it, but now I don't have to.
The operation of the method is simple 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';// changes all empty user passwords to non-empty passwords.
Mysql > FLUSH PRIVILEGES
Mysql > quit # / etc/init.d/mysqld restart
# mysql-uroot-p
Enter password:
MySql5.6 Operation Times error: You must SET PASSWORD before executing this statement solution
Mysql > SET PASSWORD = PASSWORD ('123456')
Query OK, 0 rows affected (0.03 sec)
Mysql > create database roger
Query OK, 1 row affected (0.00 sec)
That is to say, use mysql > SET PASSWORD = PASSWORD ('123456'); reset the password again!
If MySQL is running, kill it first: killall-TERM mysqld.
Run mysqld_safe-- skip-grant-tables &
If you don't want to be connected remotely at this time: mysqld_safe-- skip-grant-tables-- skip-networking &
Connect to server using mysql
Change the password: update mysql.user set authentication_string=password ('123qwe') where user='root' and Host =' localhost'
* A special reminder is that there is no Password field in the user table under the new version of mysql database.
Instead, the encrypted user password is stored in the authentication_string field
Mysql > flush privileges
Mysql > quit
The modification is complete. Restart
Killall-TERM mysqld.
Mysqld_safe &
Then mysql can connect.
But at this time, the operation seems to be not fully functional, and alter user... is still needed.
Alter user 'root'@'localhost' identified by' 123'
The online article says that purple is also fine: set password for 'root'@'localhost'=password (' 123')
Self-starting
Cp mysql.server / etc/init.d/mysqlchmod + x / etc/init.d/mysqlchkconfig-- add mysql
Reboot, try it.
= =
The following methods are quick to modify:
Mysql > SET PASSWORD = PASSWORD ('new_password'); Query OK, 0 rows affected (0.01 sec) mysql > SELECT 1; +-- + | 1 | +-+ | 1 | +-+
1 row in set (0.00 sec)
Mysql password can not be changed to deal with the solution to tell you here, for other related issues you want to know can continue to follow the industry information. Our section will capture some industry news and professional knowledge to share with you every day.