MySQL-8.3.0 innovation版本已发布了,想抢先体验一下最新的功能,可以用以下的方式快速在虚拟机上安装一下
服务器环境:
[root@node213 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@node213 ~]# uname -a
Linux node213 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
1.先安装yum-utils工具:
[root@node213 ~]#yum install yum-utils
2.先到官网下载yum安装文件
mysql80-community-release-el7-11.noarch.rpm
[root@node213 ~]#wget https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm
3.安装YUM文件
[root@node213 yum.repos.d]# rpm -ivh ./mysql80-community-release-el7-11.noarch.rpm
4.修改仓库的开关状态:
开启mysql-innovation-community仓库,关闭mysql80-community仓库
[root@node213 yum.repos.d]#yum-config-manager --disable mysql80-community
[root@node213 yum.repos.d]#yum-config-manager --enable mysql-innovation-community
5.安装mysql-8.3.0最新创新版本:
[root@node213 yum.repos.d]# yum install mysql-community-server
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror.01link.hk
* extras: mirrors.aliyun.com
* updates: mirrors.ustc.edu.cn
mysql-connectors-community | 2.6 kB 00:00:00
mysql-innovation-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-server.x86_64.0.8.3.0-1.el7 将被 安装
--> 正在处理依赖关系 mysql-community-common(x86-64) = 8.3.0-1.el7,它被软件包 mysql-community-server-8.3.0-1.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-icu-data-files = 8.3.0-1.el7,它被软件包 mysql-community-server-8.3.0-1.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-client(x86-64) >= 8.0.11,它被软件包 mysql-community-server-8.3.0-1.el7.x86_64 需要
--> 正在检查事务
---> 软件包 mysql-community-client.x86_64.0.8.3.0-1.el7 将被 安装
--> 正在处理依赖关系 mysql-community-client-plugins = 8.3.0-1.el7,它被软件包 mysql-community-client-8.3.0-1.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-libs(x86-64) >= 8.0.11,它被软件包 mysql-community-client-8.3.0-1.el7.x86_64 需要
---> 软件包 mysql-community-common.x86_64.0.8.3.0-1.el7 将被 安装
---> 软件包 mysql-community-icu-data-files.x86_64.0.8.3.0-1.el7 将被 安装
--> 正在检查事务
---> 软件包 mariadb-libs.x86_64.1.5.5.68-1.el7 将被 取代
--> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 2:postfix-2.10.1-9.el7.x86_64 需要
--> 正在处理依赖关系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被软件包 2:postfix-2.10.1-9.el7.x86_64 需要
---> 软件包 mysql-community-client-plugins.x86_64.0.8.3.0-1.el7 将被 安装
---> 软件包 mysql-community-libs.x86_64.0.8.3.0-1.el7 将被 舍弃
--> 正在检查事务
---> 软件包 mysql-community-libs-compat.x86_64.0.8.3.0-1.el7 将被 舍弃
--> 解决依赖关系完成
依赖关系解决
==================================================================================================================
Package 架构 版本 源 大小
==================================================================================================================
正在安装:
mysql-community-libs x86_64 8.3.0-1.el7 mysql-innovation-community 1.5 M
替换 mariadb-libs.x86_64 1:5.5.68-1.el7
mysql-community-libs-compat x86_64 8.3.0-1.el7 mysql-innovation-community 670 k
替换 mariadb-libs.x86_64 1:5.5.68-1.el7
mysql-community-server x86_64 8.3.0-1.el7 mysql-innovation-community 65 M
为依赖而安装:
mysql-community-client x86_64 8.3.0-1.el7 mysql-innovation-community 16 M
mysql-community-client-plugins x86_64 8.3.0-1.el7 mysql-innovation-community 3.5 M
mysql-community-common x86_64 8.3.0-1.el7 mysql-innovation-community 682 k
mysql-community-icu-data-files x86_64 8.3.0-1.el7 mysql-innovation-community 2.2 M
事务概要
==================================================================================================================
安装 3 软件包 (+4 依赖软件包)
总下载量:90 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql-innovation-community/packages/mysql-community-client-plugins-8.3.0-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID a8d3785c: NOKEY
mysql-community-client-plugins-8.3.0-1.el7.x86_64.rpm 的公钥尚未安装
(1/7): mysql-community-client-plugins-8.3.0-1.el7.x86_64.rpm | 3.5 MB 00:00:11
(2/7): mysql-community-common-8.3.0-1.el7.x86_64.rpm | 682 kB 00:00:02
(3/7): mysql-community-icu-data-files-8.3.0-1.el7.x86_64.rpm | 2.2 MB 00:00:07
(4/7): mysql-community-libs-8.3.0-1.el7.x86_64.rpm | 1.5 MB 00:00:04
(5/7): mysql-community-libs-compat-8.3.0-1.el7.x86_64.rpm | 670 kB 00:00:02
(6/7): mysql-community-client-8.3.0-1.el7.x86_64.rpm | 16 MB 00:00:45
(7/7): mysql-community-server-8.3.0-1.el7.x86_64.rpm | 65 MB 00:04:37
------------------------------------------------------------------------------------------------------------------
总计 300 kB/s | 90 MB 00:05:06
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023 检索密钥
导入 GPG key 0xA8D3785C:
用户ID : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
指纹 : bca4 3417 c3b4 85dd 128e c6d4 b7b3 b788 a8d3 785c
软件包 : mysql80-community-release-el7-11.noarch (installed)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023
是否继续?[y/N]:y
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 检索密钥
导入 GPG key 0x3A79BD29:
用户ID : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
指纹 : 859b e8d7 c586 f538 430b 19c2 467b 942d 3a79 bd29
软件包 : mysql80-community-release-el7-11.noarch (installed)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : mysql-community-common-8.3.0-1.el7.x86_64 1/8
正在安装 : mysql-community-client-plugins-8.3.0-1.el7.x86_64 2/8
正在安装 : mysql-community-libs-8.3.0-1.el7.x86_64 3/8
正在安装 : mysql-community-client-8.3.0-1.el7.x86_64 4/8
正在安装 : mysql-community-icu-data-files-8.3.0-1.el7.x86_64 5/8
正在安装 : mysql-community-server-8.3.0-1.el7.x86_64 6/8
正在安装 : mysql-community-libs-compat-8.3.0-1.el7.x86_64 7/8
正在删除 : 1:mariadb-libs-5.5.68-1.el7.x86_64 8/8
验证中 : mysql-community-client-plugins-8.3.0-1.el7.x86_64 1/8
验证中 : mysql-community-common-8.3.0-1.el7.x86_64 2/8
验证中 : mysql-community-icu-data-files-8.3.0-1.el7.x86_64 3/8
验证中 : mysql-community-libs-8.3.0-1.el7.x86_64 4/8
验证中 : mysql-community-client-8.3.0-1.el7.x86_64 5/8
验证中 : mysql-community-libs-compat-8.3.0-1.el7.x86_64 6/8
验证中 : mysql-community-server-8.3.0-1.el7.x86_64 7/8
验证中 : 1:mariadb-libs-5.5.68-1.el7.x86_64 8/8
已安装:
mysql-community-libs.x86_64 0:8.3.0-1.el7 mysql-community-libs-compat.x86_64 0:8.3.0-1.el7
mysql-community-server.x86_64 0:8.3.0-1.el7
作为依赖被安装:
mysql-community-client.x86_64 0:8.3.0-1.el7 mysql-community-client-plugins.x86_64 0:8.3.0-1.el7
mysql-community-common.x86_64 0:8.3.0-1.el7 mysql-community-icu-data-files.x86_64 0:8.3.0-1.el7
替代:
mariadb-libs.x86_64 1:5.5.68-1.el7
完毕!
5.启动MySQL数据库服务:
[root@node213 ~]# systemctl start mysqld
6.查看MySQL数据库生成的临时root登录密码:
[root@node213 ~]# cat /var/log/mysqld.log | grep password
2024-01-22T01:48:55.593788Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: /4Zm_4ljMyxj
7.通过临时密码登录数据库:
临时密码为:/4Zm_4ljMyxj
[root@node213 ~]# mysql -uroot -p'/4Zm_4ljMyxj' -hlocalhost
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.3.0
Copyright (c) 2000, 2024, 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.
8.登录数据库后,要修改root密码:
mysql> alter user root@localhost identified by 'Rscpass123_';
9.查看数据库的版本:
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.3.0 |
+-----------+
1 row in set (0.01 sec)
mysql> \s
--------------
mysql Ver 8.3.0 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 8
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.3.0
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/lib/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 3 min 4 sec
Threads: 2 Questions: 8 Slow queries: 0 Opens: 130 Flush tables: 3 Open tables: 46 Queries per second avg: 0.043
--------------
10.如果想免密登录数据库,可以在my.cnf文件中这样配置:
在my.cnf文件最后面添加以下行:
[mysql]
user=root
password=Rscpass123_
保存后就可以直接通过mysql登录数据库了,不需要重启哈
[root@node213 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.3.0 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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>
这种方法对于测试环境还是很有用哈,在8.0之后,有个操作系统验证的插件,可以实现一样的功能,这个下次再分享哈
至此,MySQL-8.3.0最新创新版本安装配置完成,8.3.0版本也有很多新功能哦,一起体验一下哈。。。
作者:阮胜昌 MySQL 8.0 OCP、Oracle 11G OCP,人大金仓KCP PostgreSQL PCA,Oceanbase OBCA、PingCAP PCTA、软考中级数据库系统工程师、RHCE7.0、cisco CCNA认证
擅长主流数据库MySQL、Oracle、PostgreSQL运维与开发、数据恢复、安装配置、数据迁移、集群容灾、SQL性能优化、高可用架构设计、故障应急处理等
可提供技术业务:
1.DB故障处理/疑难杂症远程支援
2.Mysql/PG/Oracle/SQLSERVER数据库技术服务
欢迎关注我的博客:http://www.linuxmysql.com 第一时间一起学习新知识!