High Technology & Service All customers want to happen.

Support

Board

Password expiration policy in MySQL Server 5.7

MYSQL
작성자
nstor
작성일
2016-08-12 03:19
조회
2854
Mysql 설치후 기본 패스워드가 없는데 버전이 바뀌고 패스워드를 요구한다.

Password expiration policy in MySQL Server 5.7 때문이다.

최초 기본디비생성후 구동시키면 아래 굵은글자로 표시된 패스워드가 생성된다.

또는 /root/.mysql_secret 생성된 파일을 보면 패스워드가 존재한다

[root@db ~]# adduser mysql -M -s /bin/false -g mysql
[root@db ~]# unzip V97613-01.zip 
Archive:  V97613-01.zip
extracting: mysql-commercial-common-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-server-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-embedded-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-libs-compat-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-client-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-embedded-devel-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-devel-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-libs-5.7.9-1.1.el5.x86_64.rpm  
extracting: mysql-commercial-test-5.7.9-1.1.el5.x86_64.rpm  
extracting: README.txt              
[root@db ~]# rpm -ivh mysql-* --nodeps
경고: mysql-commercial-client-5.7.9-1.1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 5072e1f5
준비 중...                  ########################################### [100%] 1:mysql-commercial-common########################################### [ 11%] 2:mysql-commercial-libs  ########################################### [ 22%] 3:mysql-commercial-client########################################### [ 33%] 4:mysql-commercial-server########################################### [ 44%] 5:mysql-commercial-embedd########################################### [ 56%] 6:mysql-commercial-test  ########################################### [ 67%] 7:mysql-commercial-libs-c########################################### [ 78%] 8:mysql-commercial-devel ########################################### [ 89%] 9:mysql-commercial-embedd########################################### [100%]
[root@db log]# tail -F mysqld.log 
2015-11-17T10:18:57.038907Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-17T10:18:57.374358Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-11-17T10:18:57.425622Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-11-17T10:18:57.469921Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 9cd4720c-8d14-11e5-8797-000c29e4d932.
2015-11-17T10:18:57.473337Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-11-17T10:18:58.337016Z 0 [Warning] CA certificate ca.pem is self signed.
2015-11-17T10:18:58.927604Z 1 [Note] A temporary password is generated for root@localhost: rIjw<%ixw5fp
[root@db log]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.7.9-enterprise-commercial-advanced

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> 
mysql> SET PASSWORD = PASSWORD('Xxx0000!@#');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show databases;
+--------------------+
| Database                |
+--------------------+
| information_schema  |
| mysql                     |
| performance_schema |
| sys                         |
+--------------------+
4 rows in set (0.00 sec)

mysql>
top