MySQL 的 rpm 包下载地址:
- http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-8.0/
- # 下载 mysql8.0.19 版本
- MySQL-community-client-8.0.19-1.el7.x86_64.rpm
- MySQL-community-common-8.0.19-1.el7.x86_64.rpm
- MySQL-community-libs-8.0.19-1.el7.x86_64.rpm
- MySQL-community-server-8.0.19-1.el7.x86_64.rpm
注意安装顺序 common -> libs -> client -> server
- rpm -ivh MySQL-community-common-8.0.19-1.el8.x86_64.rpm
- [[email protected] data]# rpm -ivh MySQL-community-server-8.0.19-1.el7.x86_64.rpm
- warning: MySQL-community-server-8.0.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
- error: Failed dependencies:
- libaio.so.1()(64bit) is needed by MySQL-community-server-8.0.19-1.el7.x86_64
- libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-community-server-8.0.19-1.el7.x86_64
- libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-community-server-8.0.19-1.el7.x86_64
- net-tools is needed by MySQL-community-server-8.0.19-1.el7.x86_64
- # 解决办法:
- yum install.NET-tools.x86_64 libaio -y
- # 初始密码在日志中
- [[email protected] data]# more /var/log/mysqld.log
- 2020-03-12T16:11:00.530337Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.19) initializing of server in progress as process 32091
- 2020-03-12T16:11:08.553289Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: Vct!CiL9qlo&
- 2020-03-12T16:11:12.228434Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 32140
- 2020-03-12T16:11:13.459708Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
- 2020-03-12T16:11:13.515224Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19' socket: '/var/lib/mysql/mysql.sock' port: 3306 My
SQL Community Server - GPL.
- 2020-03-12T16:11:13.571225Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
- # 修改 root 密码
- MySQL> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Jad(2020';
- Query OK, 0 rows affected (0.01 sec)
- MySQL> flush privileges;
- Query OK, 0 rows affected (0.02 sec)
来源: http://www.bubuko.com/infodetail-3460227.html