mysql-connectors-community/x86_64 MySQL Connectors Community 118
mysql-tools-community/x86_64 MySQL Tools Community 95
mysql80-community/x86_64 MySQL 8.0 Community Server 129
5、看到有MySQL 8.0版本之后,就可以正式开始安装MySQL了。
# yum install -y mysql-community-server
6、完成后启动MySQL
# systemctl start mysqld
7、查看MySQL启动状态
# systemctl status mysqld
8、 MySQL安装完成之后会在LOG文件( /var/log/mysqld.log)中生成一个默认的临时密码,可根据自己的实际情况修改(冒号后面为旧密码)。
2019-08-24T05:32:58.277335Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.17) initializing of server in progress as process 58121
2019-08-24T05:33:04.727785Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: jb_klPPYe12W
2019-08-24T05:33:06.400398Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.17) initializing of server has completed
2019-08-24T05:33:09.808077Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 58170
2019-08-24T05:33:12.378185Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-08-24T05:33:12.428422Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.17' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2019-08-24T05:33:12.522176Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
9、登录MySQL并修改root密码
mysql -uroot -p
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'Linuxidc.com@123';
这里的Linuxidc.com@123 为新密码。
新密码强度默认为中等,需要同时有大小写字母、数字、特殊符号,只有修改成功后才能修改配置再设置更简单的密码,具体见 https://www.linuxidc.com/Linux/2019-08/160317.htm 。
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx