MySQL installation prompt password expiration resolution

Source: Internet
Author: User

MySQL [email protected]-P
Enter Password:
ERROR 1862 (HY000): Your password has expired. To log the must change it using a client that supports expired passwords.

Modify

Vim/etc/my.cnf

datadir=/home/mysql/dataport = 3306user = mysqlcharacter_set_server=utf8skip-grant-tables

/etc/my.cnf "31L, 704C written
[Email protected] mysql]#
[Email protected] mysql]#
[Email protected] mysql]# service mysqld restart
Shutting down MySQL. [OK]
Starting MySQL. [OK]
[[email protected] mysql]# MySQL
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.7.18 MySQL Community Server (GPL)

Copyright (c), Oracle, MariaDB Corporation Ab and others.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

MySQL [(None)]>
MySQL [(None)]>
MySQL [(None)]>
MySQL [(None)]>
MySQL [(None)]>
MySQL [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| SYS |
+--------------------+
4 rows in Set (0.00 sec)

MySQL [(none)]> use MySQL
Reading table information for completion of table and column names
Can turn off this feature to get a quicker startup with-a

Database changed
MySQL [mysql]>
MySQL [mysql]>
MySQL [mysql]> SELECT * from Mysql.user where user= ' root ' \g
1. Row
Host:localhost
User:root
Select_priv:y
Insert_priv:y
Update_priv:y
Delete_priv:y
Create_priv:y
Drop_priv:y
Reload_priv:y
Shutdown_priv:y
Process_priv:y
File_priv:y
Grant_priv:y
References_priv:y
Index_priv:y
Alter_priv:y
Show_db_priv:y
Super_priv:y
Create_tmp_table_priv:y
Lock_tables_priv:y
Execute_priv:y
Repl_slave_priv:y
Repl_client_priv:y
Create_view_priv:y
Show_view_priv:y
Create_routine_priv:y
Alter_routine_priv:y
Create_user_priv:y
Event_priv:y
Trigger_priv:y
Create_tablespace_priv:y
Ssl_type:
Ssl_cipher:
X509_issuer:
X509_subject:
max_questions:0
max_updates:0
max_connections:0
max_user_connections:0
Plugin:mysql_native_password
Authentication_string: *6bb4837eb74329105ee4568dda7dc67ed2ca2ad9
Password_expired:y
password_last_changed:2018-06-29 11:42:11
Password_lifetime:null
Account_locked:n
1 row in Set (0.00 sec)

MySQL [mysql]> Update user set password_expired= ' N ' where user= ' root ';
Query OK, 1 row affected (0.01 sec)
Rows matched:1 changed:1 warnings:0

MySQL [mysql]> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)

MySQL [mysql]> SELECT * from Mysql.user where user= ' root ' \g
1. Row
Host:localhost
User:root
Select_priv:y
Insert_priv:y
Update_priv:y
Delete_priv:y
Create_priv:y
Drop_priv:y
Reload_priv:y
Shutdown_priv:y
Process_priv:y
File_priv:y
Grant_priv:y
References_priv:y
Index_priv:y
Alter_priv:y
Show_db_priv:y
Super_priv:y
Create_tmp_table_priv:y
Lock_tables_priv:y
Execute_priv:y
Repl_slave_priv:y
Repl_client_priv:y
Create_view_priv:y
Show_view_priv:y
Create_routine_priv:y
Alter_routine_priv:y
Create_user_priv:y
Event_priv:y
Trigger_priv:y
Create_tablespace_priv:y
Ssl_type:
Ssl_cipher:
X509_issuer:
X509_subject:
max_questions:0
max_updates:0
max_connections:0
max_user_connections:0
Plugin:mysql_native_password
Authentication_string: *6bb4837eb74329105ee4568dda7dc67ed2ca2ad9
Password_expired:n
password_last_changed:2018-06-29 11:42:11
Password_lifetime:null
Account_locked:n
1 row in Set (0.00 sec)

MySQL installation prompt password expiration resolution

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.