卸载旧版本的MySQL:yum remove mysql mysql-*
查看mysql组件:rpm -qa | grep mysql
rpm -ivh mysql80-community-release-el6.rpm[root@localhost ~]# rpm -ivh mysql80-community-release-el6.rpm
warning: mysql80-community-release-el6.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql80-community-relea########################################### [100%]
安装:yum install mysql-server[root@localhost ~]# yum install mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
mysql80-community | 2.5 kB 00:00
mysql80-community/primary_db | 36 kB 00:00
Setting up Install Process
Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-community-server-8.0.13-1.el6.x86_64 instead
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:8.0.13-1.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 8.0.13-1.el6 for package: mysql-community-server-8.0.13-1.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 8.0.0 for package: mysql-community-server-8.0.13-1.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:8.0.13-1.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.0 for package: mysql-community-client-8.0.13-1.el6.x86_64
---> Package mysql-community-common.x86_64 0:8.0.13-1.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:8.0.13-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
mysql-community-server x86_64 8.0.13-1.el6 mysql80-community 425 M
Installing for dependencies:
mysql-community-client x86_64 8.0.13-1.el6 mysql80-community 28 M
mysql-community-common x86_64 8.0.13-1.el6 mysql80-community 673 k
mysql-community-libs x86_64 8.0.13-1.el6 mysql80-community 2.5 M
Transaction Summary
================================================================================================================================================================================
Install 4 Package(s)
Total download size: 456 M
Installed size: 1.8 G
Is this ok [y/N]: y
Downloading Packages:
(1/4): mysql-community-client-8.0.13-1.el6.x86_64.rpm | 28 MB 00:15
(2/4): mysql-community-common-8.0.13-1.el6.x86_64.rpm | 673 kB 00:00
(3/4): mysql-community-libs-8.0.13-1.el6.x86_64.rpm | 2.5 MB 00:01
(4/4): mysql-community-server-8.0.13-1.el6.x86_64.rpm | 425 MB 06:11
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.2 MB/s | 456 MB 06:29
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-8.0.13-1.el6.x86_64 1/4
Installing : mysql-community-libs-8.0.13-1.el6.x86_64 2/4
Installing : mysql-community-client-8.0.13-1.el6.x86_64 3/4
Installing : mysql-community-server-8.0.13-1.el6.x86_64 4/4
Verifying : mysql-community-server-8.0.13-1.el6.x86_64 1/4
Verifying : mysql-community-common-8.0.13-1.el6.x86_64 2/4
Verifying : mysql-community-libs-8.0.13-1.el6.x86_64 3/4
Verifying : mysql-community-client-8.0.13-1.el6.x86_64 4/4
Installed:
mysql-community-server.x86_64 0:8.0.13-1.el6
Dependency Installed:
mysql-community-client.x86_64 0:8.0.13-1.el6 mysql-community-common.x86_64 0:8.0.13-1.el6 mysql-community-libs.x86_64 0:8.0.13-1.el6
Complete!
检查是否安装成功: mysqladmin -V[root@localhost ~]# mysqladmin -V
mysqladmin Ver 8.0.13 for Linux on x86_64 (MySQL Community Server - GPL)
启动:
service mysqld start
service mysqld status
启动失败:2018-12-26T00:32:10.962636Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 10658
2018-12-26T00:32:11.107451Z 1 [ERROR] [MY-013090] [InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9
2018-12-26T00:32:11.107536Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2018-12-26T00:32:11.608776Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2018-12-26T00:32:11.609275Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-26T00:32:11.609337Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-26T00:32:11.610955Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
清空:/var/lib/mysql
启动日志:2018-12-26T00:35:52.497269Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server in progress as process 10747
2018-12-26T00:35:55.780743Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: nyJKVtP=i5lh
2018-12-26T00:35:57.738825Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server has completed
2018-12-26T00:36:00.106701Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 11028
2018-12-26T00:36:00.866349Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-12-26T00:36:00.908009Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2018-12-26T00:36:01.072640Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
其中:nyJKVtP=i5lh 是初始化密码。
登录后mysql> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
修改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY 'L**D**!**4';
注意:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
密码策略,符合一定的安全复杂度。