【MySQL】MySQL 8.4.0 长期支持版(LTS)安装

        就在2024年 “5.1” 节前,MySQL官方发布了8.4.0长期支持版(LTS - Long Term Support)。根据官方提供的文档,在本地虚拟机进行安装测试。

        安装、配置和启动过程记录如下:

        第一步,上传到安装包(mysql-commercial-8.4.0-linux-glibc2.17-x86_64.tar.xz)到虚拟机,并解压。

[root@vm-3rd89n7dd ~]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring mysql-commercial-8.4.0-linux-glibc2.17-x86_64.tar.xz...100%  518611 KB    27295 KB/sec    00:00:19       0 Errors  
[root@vm-3rd89n7dd ~]# tar -xf mysql-commercial-8.4.0-linux-glibc2.17-x86_64.tar.xz
[root@vm-3rd89n7dd ~]# mv mysql-commercial-8.4.0-linux-glibc2.17-x86_64 /usr/local/mysql

        第二步,创建mysql用户和组,并给相关目录授权。

[root@vm-3rd89n7dd ~]# groupadd mysql
[root@vm-3rd89n7dd ~]# useradd -r -g mysql -s /bin/false mysql
[root@vm-3rd89n7dd ~]# cd /usr/local/mysql
[root@vm-3rd89n7dd mysql]# mkdir mysql-files
[root@vm-3rd89n7dd mysql]# chown mysql:mysql mysql-files
[root@vm-3rd89n7dd mysql]# chmod 750 mysql-files

        第三步,用户密码初始化(注意下面信息打印出来 temporary password ,登录数据库操作时,会提示必须修改

[root@vm-3rd89n7dd mysql]# bin/mysqld --initialize --user=mysql
2024-05-07T06:22:58.045209Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2024-05-07T06:22:58.047263Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.4.0-commercial) initializing of server in progress as process 3904
2024-05-07T06:22:58.064126Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-07T06:22:59.175074Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-07T06:23:01.261487Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: jgR;k1H4Wa!f
2024-05-07T06:23:04.365176Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

        第四步,将mysql.server添加为系统服务,并启动mysql服务

[root@vm-3rd89n7dd mysql]# cp support-files/mysql.server /etc/init.d/mysql.server
[root@vm-3rd89n7dd mysql]# chkconfig --add mysql.server
[root@vm-3rd89n7dd mysql]# systemctl start mysql.server
[root@vm-3rd89n7dd mysql]# systemctl status mysql.server
● mysql.server.service - LSB: start and stop MySQLLoaded: loaded (/etc/rc.d/init.d/mysql.server; bad; vendor preset: disabled)Active: active (exited) since 二 2024-05-07 14:28:58 CST; 12s agoDocs: man:systemd-sysv-generator(8)Process: 4224 ExecStart=/etc/rc.d/init.d/mysql.server start (code=exited, status=0/SUCCESS)5月 07 14:28:58 vm-3rd89n7dd systemd[1]: Starting LSB: start and stop MySQL...
5月 07 14:28:58 vm-3rd89n7dd mysql.server[4224]: Starting MySQL SUCCESS!
5月 07 14:28:58 vm-3rd89n7dd systemd[1]: Started LSB: start and stop MySQL.
5月 07 14:28:58 vm-3rd89n7dd mysql.server[4224]: 2024-05-07T06:28:58.247390Z mysqld_safe A mysqld process already exists

        第五步,修改临时密码

[root@vm-3rd89n7dd ~]# mysqladmin -uroot -p'jgR;k1H4Wa!f' password 'YourPassword'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

        如果不修改临时密码,并使用临时密码登录操作数据库,系统也会提示修改

[root@vm-3rd89n7dd ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.4.0-commercialCopyright (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> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> exit
Bye

        第六步,为mysql设置环境变量,增加 /usr/local/mysql/bin 路径配置

root@vm-3rd89n7dd ~]# vi .bash_profile 
# .bash_profile# Get the aliases and functions
if [ -f ~/.bashrc ]; then. ~/.bashrc
fi# User specific environment and startup programs
JAVA_HOME=/usr/jdk1.8.0_411
export JAVA_HOMECLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export CLASSPATHPATH=$JAVA_HOME/bin:$PATH:/usr/local/bin:/usr/local/mysql/bin:$HOME/bin
export PATH[root@vm-3rd89n7dd ~]# source .bash_profile

        第七步,登录和操作数据库测试

[root@vm-3rd89n7dd ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.4.0-commercial MySQL Enterprise Server - CommercialCopyright (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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)mysql> exit
Bye

        以上就是MySQL 8.4.0 LTS版本安装、运行的一个基本过程(注意:过程中并未涉及数据库的详细配置,需要的可以在安装过程中自行添加相关配置)。

参考:

https://dev.mysql.com/doc/refman/8.4/en/binary-installation.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/8106.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

西奥CHT-01软胶囊硬度测试仪:重塑行业标杆,引领硬度测试新纪元

西奥CHT-01软胶囊硬度测试仪:重塑行业标杆,引领硬度测试新纪元 在当今医药领域,软胶囊作为一种广泛应用的药品剂型,其品质的稳定性和安全性直接关系到患者的健康。而在确保软胶囊品质的各项指标中,硬度测试尤为关键。…

机试:老张和女儿一起玩芭比娃娃卡片游戏,老张希望女儿可以获得更多的卡片,老张只从重复的卡片中抽取一张留给自己,请帮助老张设计程序,输出女儿得到卡片列表

#include <iostream> #include <vector> #include <unordered_set> #include <sstream>using namespace std;string getCards(vector<int>& cards) {unordered_set<int> s; // 去重for (int i 0; i < cards.size(); i) {s.insert(…

SpringCloud中LoadBalancer负载均衡器配置

SpringCloud中LoadBalancer负载均衡器配置 依赖 <dependencies><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency><dependency><g…

探索Spring中的StandardCharsets:字符编码的艺术与实践

1. 概述 在Java编程中&#xff0c;StandardCharsets是一个静态类&#xff0c;它提供了一组标准的字符集&#xff08;Charset&#xff09;常量&#xff0c;用于在字节和字符之间进行转换。虽然StandardCharsets并不直接属于Spring框架的一部分&#xff0c;但它在Spring和Java应…

[oeasy]python0016_在vim中直接运行python程序

回忆上次内容 上次 置换 esc 和 caps lock 任何操作 都可以在不移动 手腕的状态下完成了 每次都要 退出vim编辑器&#x1f634; 才能 在shell中 运行python程序有点麻烦 想要 不退出vim 直接在 vim应用 中运行 py程序可能吗&#xff1f;&#x1f914; 运行程序 以前都是 先退…

Unity 性能优化之UI和模型优化(九)

提示&#xff1a;仅供参考&#xff0c;有误之处&#xff0c;麻烦大佬指出&#xff0c;不胜感激&#xff01; 文章目录 前言一、选择UI二、UGUI的优化1.Raycast Target2.UI控件的重叠3.TextMeshPro 二、模型优化1.Model选项卡Mesh CompressionRead/Write Enabled设置Optimize Ga…

C语言怎样从/向数据⽂件读/写结构?

一、问题 从数据⽂件读结构或者向数据⽂件写结构&#xff0c;都可以很轻松地使⽤⽂件读写函数实现&#xff0c; 如使⽤ fwrite( ) 函数写⼀个结构&#xff0c;使⽤ fread( ) 函数读⼀个结构&#xff0c;但是这样读写出的⽂件却不能移植。怎么从/向数据⽂件读/写结构才能更好呢&…

MySQL分区与分片:深入解析原理与应用

在大数据和高并发的应用场景中&#xff0c;MySQL的单一表可能会遇到性能瓶颈或存储限制。为了解决这个问题&#xff0c;MySQL提供了分区&#xff08;Partitioning&#xff09;和分片&#xff08;Sharding&#xff09;两种技术。虽然它们的目的都是为了提升性能&#xff0c;但实…

【python数据分析基础】—pandas透视表和交叉表

目录 前言一、pivot_table 透视表二、crosstab 交叉表三、实际应用 前言 透视表是excel和其他数据分析软件中一种常见的数据汇总工具。它是根据一个或多个键对数据进行聚合&#xff0c;并根据行和列上的分组键将数据分配到各个矩形区域中。 一、pivot_table 透视表 pivot_tabl…

【MySQL】MySQL基本知识点

目录 1.SQL分类&#xff1a; 2.DDL-数据库操作 3.DDL-表操作-创建 4.DDL-表操作-查询 5.DDL-表操作-数据类型 6.DDL-表操作-修改 1.SQL分类&#xff1a; 2.DDL-数据库操作 3.DDL-表操作-创建 注意&#xff1a;里面的符号全部要切换为英文状态 4.DDL-表操作-查询 5.DDL…

车路云一体化简介

车路云一体化 车路云一体化融合控制系统&#xff08; System of Coordinated Control by Vehicle-Road-Cloud Integration&#xff0c;SCCVRCI&#xff09;&#xff0c;是利用新一代信息与通信技术&#xff0c; 将人、车、路、云的物理层、信息层、应用层连为一体&#xff0c;…

Linux网络编程(三)IO复用二 poll系统调用

二、poll系统调用 2.1、API poll系统调用和select类似&#xff0c;也是在指定时间内轮询一定数量的文件描述符&#xff0c;以测试其中是否有就绪者。 #include <poll.h>int poll(struct pollfd* fds, nfds_t nfds, int timeout);fds参数是一个pollfd结构类型的数组&am…

切实有效的提高VMWARE游戏性能-各版本通杀 vm17pro

这里的游戏性能&#xff0c;当然了&#xff0c;特别指出的是3D性能&#xff0c;毕竟现在2D也很少了。 因为平时没啥事&#xff0c;所以&#xff0c;无聊就跟朋友挂挂游戏&#xff0c;没事写点代码折腾下。所以&#xff0c;免不了跟VMWARE搭上边。走了很多的弯路&#xff0c;中…

使用动态种子的DGA:DNS流量中的意外行为

Akamai研究人员最近在域名系统&#xff08;DNS&#xff09;流量数据中观察到&#xff1a;使用动态种子的域名生成算法&#xff08;Domain Generation Algorithm&#xff0c;DGA&#xff09;的实际行为&#xff0c;与对算法进行逆向工程推测的预期行为之间存在一些差异。也就是说…

Android 系统启动流程源码分析

一、Init进程启动 是一个由内核启动的用户级进程。内核自行启动之后&#xff0c;就通过启动一个用户级程序init的方式&#xff0c;完成引导进程。 启动的代码init.c中的main函数执行过程&#xff1a;system\core\init.c中&#xff1a; 主要下面两个重要的过程&#xff1a; 1…

批量将GOID转成GO term名并添加BP,MF,CC分类信息

基因本体论&#xff08;Gene Ontology&#xff0c;GO&#xff0c;https://www.geneontology.org&#xff09;是一个广泛应用于生物信息学领域的知识库&#xff0c;它提供了一套标准化的词汇和分类体系&#xff0c;用于描述基因功能、细胞组分和生物过程。GO旨在统一科研人员对基…

无人机+垂直起降:微型共轴双旋翼无人机技术详解

微型共轴双旋翼无人机技术是一种独特的无人机设计&#xff0c;它结合了垂直起降&#xff08;VTOL&#xff09;能力和微型无人机的灵活性。这种设计允许无人机在无需跑道的情况下垂直起降&#xff0c;并具备在空中悬停和执行各种飞行动作的能力。 适用于集群控制&#xff0c;荷载…

自动选择图表类型:基于数据特征智能决策

前言 在数据可视化的世界中&#xff0c;选择正确的图表类型对于有效地传达信息至关重要。图表类型的选择不仅影响数据的呈现方式&#xff0c;而且直接影响观众对数据的理解。自动选择图表类型可以大大简化数据分析的流程&#xff0c;尤其是在处理动态源或大量数据集时。本文将…

NXP i.MX8系列平台开发讲解 - 1.1 导读前言

专栏文章目录传送门&#xff1a;返回专栏目录 文章目录 目录 1. 本专辑介绍 2. 学习本专辑作用 3.关于作者 1. 本专辑介绍 本专辑将会介绍Linux 驱动开发&#xff0c;Android BSP 驱动涉及HAL层调试&#xff0c;适用于嵌入式软件开发人员&#xff0c;和有兴趣向该方向发展…

基于单片机的无线数据传输系统设计

摘要:基于单片机的无线数据传输系统的设计,实现了温度和湿度的自动采集、无线通讯和报警功能。该系统包括了LCD1602显示电路、DHT11温湿度采集电路等,完成了基于无线数据传输的方法来实现温湿度的采集。 关键词:温湿度检测;N RF 24 L 01;单片机 0 引言 随着科技水平的提高,…