mysql8.0部署
1、通过 rpm -qa | grep mariadb 命令查看 mariadb 的安装包
rpm -e mariadb-libs-x.x.xx-x.xxx.x86_64 --nodeps
2、删除系统自带的mysql及其依赖(防止冲突)
2、删除系统自带的mysql及其依赖(防止冲突)
2、给CentOS添加rpm源,并且选择较新的源
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
rpm -ivh mysql80-community-release-el8-1.noarch.rpm --force --nodeps
yum makecache
[root@host-193-168-195-19 ~]# yum list | grep mysql-com
mysql-community-client.x86_64 8.0.27-1.el8 @mysql80-community
mysql-community-client-plugins.x86_64 8.0.27-1.el8 @mysql80-community
mysql-community-common.x86_64 8.0.27-1.el8 @mysql80-community
mysql-community-libs.x86_64 8.0.27-1.el8 @mysql80-community
mysql-community-server.x86_64 8.0.27-1.el8
[root@host-193-168-195-19 ~]# yum install mysql-community-server.x86_64
[root@host-193-168-195-19 ~]# cd /var/lib/mysql
[root@host-193-168-195-19 mysql]# systemctl start mysqld
[root@host-193-168-195-19 mysql]# ls
auto.cnf client-cert.pem ibdata1 mysql private_key.pem undo_001
binlog.000001 client-key.pem ib_logfile0 mysql.ibd public_key.pem undo_002
binlog.index '#ib_16384_0.dblwr' ib_logfile1 mysql.sock server-cert.pem
ca-key.pem '#ib_16384_1.dblwr' ibtmp1 mysql.sock.lock server-key.pem
ca.pem ib_buffer_pool '#innodb_temp' performance_schema sys
[root@host-193-168-195-19 mysql]# grep "password" /var/log/mysqld.log #查看临时密码
2021-10-22T06:52:51.562210Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: #mysql2
[root@host-193-168-195-18 ~]# grep "password" /var/log/mysqld.log
2021-10-22T07:41:16.645357Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: #mysql1
[root@host-193-168-195-18 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.27
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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>