Title, the user table below the mysql5.7 MySQL library does not have a password field to modify the password.
Version 5.7 is no longer using password as the field of the password and changed to Authentication_string
Login password cannot be remembered:
[Email protected] ~]# mysql-uroot-penter password:error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Change Configuration
vi /etc/my.cnf# Add Skip-grant-tables under the Mysqld module
Restart Service
Systemctl Restart Mysqld
According to the traditional method of password change found no password this field.
mysql> Update user Set Password=password ('123') where user='root '1054'password'in'field List '
Querying the user table structure
Mysql>desc user;+------------------------+-----------------------------------+------+-----+-----------------------+-------+| Field | Type | Null | Key | Default | Extra |+------------------------+-----------------------------------+------+-----+-----------------------+------ -+| Host |Char( -) | NO | PRI | | || User |Char( +) | NO | PRI | | || Select_priv | Enum'N','Y') | NO | | N | || Insert_priv | Enum'N','Y') | NO | | N | || Update_priv | Enum'N','Y') | NO | | N | || Delete_priv | Enum'N','Y') | NO | | N | || Create_priv | Enum'N','Y') | NO | | N | || Drop_priv | Enum'N','Y') | NO | | N | || Reload_priv | Enum'N','Y') | NO | | N | || Shutdown_priv | Enum'N','Y') | NO | | N | || Process_priv | Enum'N','Y') | NO | | N | || File_priv | Enum'N','Y') | NO | | N | || Grant_priv | Enum'N','Y') | NO | | N | || References_priv | Enum'N','Y') | NO | | N | || Index_priv | Enum'N','Y') | NO | | N | || Alter_priv | Enum'N','Y') | NO | | N | || Show_db_priv | Enum'N','Y') | NO | | N | || Super_priv | Enum'N','Y') | NO | | N | || Create_tmp_table_priv | Enum'N','Y') | NO | | N | || Lock_tables_priv | Enum'N','Y') | NO | | N | || Execute_priv | Enum'N','Y') | NO | | N | || Repl_slave_priv | Enum'N','Y') | NO | | N | || Repl_client_priv | Enum'N','Y') | NO | | N | || Create_view_priv | Enum'N','Y') | NO | | N | || Show_view_priv | Enum'N','Y') | NO | | N | || Create_routine_priv | Enum'N','Y') | NO | | N | || Alter_routine_priv | Enum'N','Y') | NO | | N | || Create_user_priv | Enum'N','Y') | NO | | N | || Event_priv | Enum'N','Y') | NO | | N | || Trigger_priv | Enum'N','Y') | NO | | N | || Create_tablespace_priv | Enum'N','Y') | NO | | N | || Ssl_type | Enum"',' any','X509','SPECIFIED') | NO | | | || Ssl_cipher | Blob | NO | | NULL | || X509_issuer | Blob | NO | | NULL | || X509_subject | Blob | NO | | NULL | || max_questions |int( One) unsigned | NO | |0| || Max_updates |int( One) unsigned | NO | |0| || max_connections |int( One) unsigned | NO | |0| || max_user_connections |int( One) unsigned | NO | |0| || Plugin |Char( -) | NO | | Mysql_native_password | || authentication_string | text | YES | | NULL | || password_expired | Enum'N','Y') | NO | | N | || password_last_changed | Timestamp | YES | | NULL | || Password_lifetime | smallint5) unsigned | YES | | NULL | || account_locked | Enum'N','Y') | NO | | N | |+------------------------+-----------------------------------+------+-----+-----------------------+-------+
I checked the web. The 5.7 Version password field is said to be changed to authentication_string password function or original password function
mysql> Update user Set Authentication_string=password ('123') where user=' Root'11 Warning (0.001 1 1
#更改配置重启mysql successfully landed
[Email protected] ~]#VI/etc/my.cnf
Note # Skip-grant-tables[[email protected]~]# systemctl Restart Mysqld[[email protected]~]# Mysql-uroot-p123mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connectionIDIs2Server Version:5.7. +-Logcopyright (c) -,2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h' forHelp. Type'\c'ToClearThe current input statement.mysql>
mysql5.7 MySQL Library The user table below does not have a password field cannot modify the password