1、当我们安装这个包时会出现以下信息,其中mysql告诉我们用户名密码
[root@promote mysql]# rpm -ivhMySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-server-advanced-5.6.22-1.el#################################[100%]
2015-05-27 12:07:49 0 [Warning] TIMESTAMP withimplicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).
2015-05-27 12:07:49 3273 [Note] InnoDB: Using atomicsto ref count buffer pool pages
2015-05-27 12:07:49 3273 [Note] InnoDB: The InnoDBmemory heap is disabled
2015-05-27 12:07:49 3273 [Note] InnoDB: Mutexes andrw_locks use GCC atomic builtins
2015-05-27 12:07:49 3273 [Note] InnoDB: Memory barrieris not used
2015-05-27 12:07:49 3273 [Note] InnoDB: Compressedtables use zlib 1.2.3
2015-05-27 12:07:49 3273 [Note] InnoDB: Using Linuxnative AIO
2015-05-27 12:07:49 3273 [Note] InnoDB: Using CPUcrc32 instructions
2015-05-27 12:07:49 3273 [Note] InnoDB: Initializingbuffer pool, size = 128.0M
2015-05-27 12:07:49 3273 [Note] InnoDB: Completedinitialization of buffer pool
2015-05-27 12:07:49 3273 [Note] InnoDB: The firstspecified data file ./ibdata1 did not exist: a new database to be created!
2015-05-27 12:07:49 3273 [Note] InnoDB: Setting file./ibdata1 size to 12 MB
2015-05-27 12:07:49 3273 [Note] InnoDB: Databasephysically writes the file full: wait...
2015-05-27 12:07:50 3273 [Note] InnoDB: Setting logfile ./ib_logfile101 size to 48 MB
2015-05-27 12:07:50 3273 [Note] InnoDB: Setting log file./ib_logfile1 size to 48 MB
2015-05-27 12:07:51 3273 [Note] InnoDB: Renaming logfile ./ib_logfile101 to ./ib_logfile0
2015-05-27 12:07:51 3273 [Warning] InnoDB: New logfiles created, LSN=45781
2015-05-27 12:07:51 3273 [Note] InnoDB: Doublewritebuffer not found: creating new
2015-05-27 12:07:52 3273 [Note] InnoDB: Doublewritebuffer created
2015-05-27 12:07:52 3273 [Note] InnoDB: 128 rollbacksegment(s) are active.
2015-05-27 12:07:52 3273 [Warning] InnoDB: Creatingforeign key constraint system tables.
2015-05-27 12:07:52 3273 [Note] InnoDB: Foreign keyconstraint system tables created
2015-05-27 12:07:52 3273 [Note] InnoDB: Creatingtablespace and datafile system tables.
2015-05-27 12:07:52 3273 [Note] InnoDB: Tablespace anddatafile system tables created.
2015-05-27 12:07:52 3273 [Note] InnoDB: Waiting forpurge to start
2015-05-27 12:07:52 3273 [Note] InnoDB: 5.6.22started; log sequence number 0
2015-05-27 12:07:52 3273 [Note] RSA private key filenot found: /var/lib/mysql//private_key.pem. Some authentication plugins willnot work.
2015-05-27 12:07:52 3273 [Note] RSA public key filenot found: /var/lib/mysql//public_key.pem. Some authentication plugins will notwork.
A random root password has been set. You will find itin '/root/.mysql_secret'.
2015-05-27 12:07:55 3273 [Note] Binlog end
2015-05-27 12:07:55 3273 [Note] InnoDB: FTS optimizethread exiting.
2015-05-27 12:07:55 3273 [Note] InnoDB: Startingshutdown...
2015-05-27 12:07:57 3273 [Note] InnoDB: Shutdowncompleted; log sequence number 1625977
2015-05-27 12:07:57 0 [Warning] TIMESTAMP withimplicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).
2015-05-27 12:07:57 3295 [Note] InnoDB: Using atomicsto ref count buffer pool pages
2015-05-27 12:07:57 3295 [Note] InnoDB: The InnoDBmemory heap is disabled
2015-05-27 12:07:57 3295 [Note] InnoDB: Mutexes andrw_locks use GCC atomic builtins
2015-05-27 12:07:57 3295 [Note] InnoDB: Memory barrieris not used
2015-05-27 12:07:57 3295 [Note] InnoDB: Compressedtables use zlib 1.2.3
2015-05-27 12:07:57 3295 [Note] InnoDB: Using Linuxnative AIO
2015-05-27 12:07:57 3295 [Note] InnoDB: Using CPUcrc32 instructions
2015-05-27 12:07:57 3295 [Note] InnoDB: Initializingbuffer pool, size = 128.0M
2015-05-27 12:07:57 3295 [Note] InnoDB: Completedinitialization of buffer pool
2015-05-27 12:07:57 3295 [Note] InnoDB: Highestsupported file format is Barracuda.
2015-05-27 12:07:57 3295 [Note] InnoDB: 128 rollbacksegment(s) are active.
2015-05-27 12:07:57 3295 [Note] InnoDB: Waiting forpurge to start
2015-05-27 12:07:57 3295 [Note] InnoDB: 5.6.22started; log sequence number 1625977
2015-05-27 12:07:57 3295 [Note] RSA private key filenot found: /var/lib/mysql//private_key.pem. Some authentication plugins willnot work.
2015-05-27 12:07:57 3295 [Note] RSA public key filenot found: /var/lib/mysql//public_key.pem. Some authentication plugins will notwork.
2015-05-27 12:07:57 3295 [Note] Binlog end
2015-05-27 12:07:57 3295 [Note] InnoDB: FTS optimizethread exiting.
2015-05-27 12:07:57 3295 [Note] InnoDB: Startingshutdown...
2015-05-27 12:07:59 3295 [Note] InnoDB: Shutdowncompleted; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER!
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will beaccepted.
See the manual for the semantics of the 'passwordexpired' flag.
Also, the account for the anonymous user has beenremoved.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing thetest database.
This is strongly recommended for production servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on theweb at
http://www.mysql.com
Support MySQL by buying support/licenses athttp://shop.mysql.com
WARNING: Found existing config file /usr/my.cnf on thesystem.
Because this file might be in use, it was notreplaced,
but was used in bootstrap (unless you used--defaults-file)
and when you later start the server.
The new default config file was created as/usr/my-new.cnf,
please compare it with your file and take the changesyou need.
2、密码存放的位置说明
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER!
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will beaccepted.
See the manual for the semantics of the 'passwordexpired' flag.
mysql告诉我们安装时随机生成的密码存放在"/root/.mysql_secret"文件中,并以root用户登陆后通过
‘SET PASSWORD’命令重新配置密码
[root@mysql ~]# cat /root/.mysql_secret
# The random password set for the root user at Tue Apr11 16:22:55 2017 (local time):kqy2gpU0wiDYWme8 此为密码3、登陆并重新配置密码
[root@web ~]# mysql -u root –p首次以root用户登陆
Enter password: kqy2gpU0wiDYWme8
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version:5.6.22-enterprise-commercial-advanced MySQL Enterprise Server - AdvancedEdition (Commercial)
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarks of theirrespective
owners.
Type 'help;' or '\h' for help. Type '\c' to clearthe current input statement.
mysql> SET PASSWORD =PASSWORD("123456");重新配置密码为123456
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql>
至止完成密码修改。