Oracle linux 8 二进制安装 MySQL 8.4企业版

简介: Oracle linux 8 二进制安装 MySQL 8.4企业版

使用命令ldd --version ldd 检查,确定MySQL 8二进制包版本

[root@mysql8_3 ~]# ldd --version ldd

安装libaio

[root@mysql8_3 ~]#yum install libaio

安装ncurses-compat-libs

[root@mysql8_3 ~]#yum install ncurses-compat-libs

创建安装目录

[root@mysql8_3 ]#mkdir /u01

创建用户

[root@mysql8_3 ]# useradd -r -g mysql -s /bin/false mysql

进入安装目录

[root@mysql8_3 u01]# cd /u01

解压安装包

[root@mysql8_3 u01]# tar xvf mysql-commercial-8.4.4-linux-glibc2.28-x86_64.tar.xz

修改安装目录名字

[root@mysql8_3 u01]# mv mysql-commercial-8.4.4-linux-glibc2.28-x86_64 mysql3308

创建程序目录

[root@mysql8_3 mysql3308]# mkdir base

把解压包的文件及文件夹移动到base目录

[root@mysql8_3 mysql3308]# mv * base/

创建数据目录

[root@mysql8_3 mysql3308]# mkdir data

给整个数据库目录赋予mysql用户及组

[root@mysql8_3 mysql3308]# cd ..
[root@mysql8_3 u01]# chown -R mysql.mysql mysql3308

对数据库进行初始化,记住初始root密码

[root@mysql8_3 mysql3308]# base/bin/mysqld --initialize --datadir=/u01/mysql3308/data/ --user=mysql
2025-04-09T06:10:07.862792Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2025-04-09T06:10:07.866074Z 0 [System] [MY-013169] [Server] /u01/mysql-commercial-8.4.4-linux-glibc2.28-x86_64/base/bin/mysqld (mysqld 8.4.4-commercial) initializing of server in progress as process 11898
2025-04-09T06:10:08.040918Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-04-09T06:10:11.812516Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-04-09T06:10:25.552364Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: fc9%Xt<E5eF/
2025-04-09T06:10:38.228926Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

测试数据库启动

[root@mysql8_3 mysql3308]# ./base/bin/mysqld_safe --datadir=/u01/mysql3308/data/ --user=mysql &
[1] 12586
[root@mysql8_3 mysql3308]# 2025-04-09T06:15:10.255451Z mysqld_safe Logging to '/u01/mysql3308/data/mysql8_3.52.err'.
2025-04-09T06:15:10.330480Z mysqld_safe Starting mysqld daemon with databases from /u01/mysql3308/data

查看启动端口

[root@mysql8_3 mysql3308]# netstat -antupl

修改root 密码

[root@mysql8_3 mysql3308]# ./base/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.

Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.4-commercial
Copyright (c) 2000, 2025, 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>
mysql> set password='123456';

测试修改后root密码登陆

[root@mysql8_3 mysql3308]# ./base/bin/mysql -uroot -p123456
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 10
Server version: 8.4.4-commercial MySQL Enterprise Server - Commercial
Copyright (c) 2000, 2025, 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> exit
Bye

添加mysql启动脚本

[root@mysql8_3 mysql3308]# cp base/support-files/mysql.server /etc/init.d/mysql.server

修改mysql启动脚本,并添加程序目录和数据目录

[root@mysql8_3 mysql3308]# vim /etc/init.d/mysql.server

If you change base dir, you must also change datadir. These may get

overwritten by settings in the MySQL configuration files.

basedir=/u01/mysql3308/base
datadir=/u01/mysql3308/data

测试mysql启动脚本

[root@mysql8_3 mysql3308]# /etc/init.d/mysql.server start
Starting MySQL.... SUCCESS!
[root@mysql8_3 mysql3308]# netstat -antupl

添加mysql环境变量

[root@mysql8_3 mysql3308]# echo "export PATH=$PATH:/u01/mysql3308/base/bin" >> /etc/profile
[root@mysql8_3 mysql3308]# source /etc/profile
[root@mysql8_3 mysql3308]# mysql -uroot -p123456
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.4.4-commercial MySQL Enterprise Server - Commercial
Copyright (c) 2000, 2025, 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>

添加mysql配置文件

[root@mysql8_3 mysql3308]# vim my.cnf
[mysqld]
user=mysql
port=3308
mysqlx_port=33080
basedir=/u01/mysql3308/base
datadir=/u01/mysql3308/data
socket = /u01/mysql3308/data/mysql.sock
pid-file = /u01/mysql3308/data/mysql.pid
log_error = /u01/mysql3308/data/mysql-error.log
log_timestamps=SYSTEM
character_set_server=utf8mb4
skip_name_resolve=1
binlog_format=row
log-bin = /u01/mysql3308/data/binlog
server-id = 03533308
skip_slave_start=1
open_files_limit=65535
innodb_buffer_pool_size=3G
innodb_log_buffer_size=16M
innodb_log_file_size=256M
sort_buffer_size = 6M

修改my.cnf文件属主

[root@mysql8_3 mysql3308]# chown mysql:mysql my.cnf

增加mysql系统自启动脚本

[root@mysql8_3 mysql3308]#

vim /usr/lib/systemd/system/mysqld83308.service

[Unit]
Description=MySQL Server
Documentation=mysqld.service
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/u01/mysql3308/base/bin/mysqld --defaults-file=/u01/mysql3308/my.cnf
LimitNOFILE = 5000

测试mysql自启动脚本

[root@mysql8_3 mysql3308]# systemctl restart mysqld83308.service
[root@mysql8_3 mysql3308]# netstat -antupl

测试mysql自启动脚本后,root登陆,由于改了sock的路径不是默认的/tmp/mysql.sock,所以登录root需要手动指定sock路径

[root@mysql8_3 mysql3308]# mysql -uroot -p123456 -S /u01/mysql3308/data/mysql.sock
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.4.4-commercial MySQL Enterprise Server - Commercial
Copyright (c) 2000, 2025, 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>

图片
6qrt4xwe6vjg6_048af03f2c4d4dc783e437bf6c59d206.png

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
相关文章
|
4月前
|
Ubuntu Linux
计算机基础知识:linux系统怎么安装?
在虚拟机软件中创建一个新的虚拟机,并选择相应操作系统类型和硬盘空间大小等参数。将下载的 ISO 镜像文件加载到虚拟机中。启动虚拟机,进入安装界面,并按照步骤进行安装。安装完成后,可以在虚拟机中使用 Linux 系统。
|
2月前
|
安全 Linux iOS开发
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
186 6
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
|
2月前
|
Ubuntu 关系型数据库 MySQL
MySQL二进制包安装
本文详细介绍了在多种Linux系统上通过二进制包安装MySQL 8.0和8.4版本的完整过程,涵盖用户创建、glibc版本匹配、程序解压、环境变量配置、初始化数据库及服务启动等步骤,并提供支持多发行版的一键安装脚本,助力高效部署MySQL环境。
298 4
MySQL二进制包安装
|
2月前
|
消息中间件 Kafka Linux
Linux下安装Kafka 3.9.1
本文介绍Kafka 3.9.1版本的安装与配置,包括通过ZooKeeper或KRaft模式启动Kafka。涵盖环境变量设置、日志路径修改、集群UUID生成、存储格式化及服务启停操作,适用于Linux环境下的部署实践。
298 0
|
3月前
|
SQL 运维 关系型数据库
深入探讨MySQL的二进制日志(binlog)选项
总结而言,对MySQL binlogs深度理解并妥善配置对数据库运维管理至关重要;它不仅关系到系统性能优化也是实现高可靠性架构设计必须考虑因素之一。通过精心规划与周密部署可以使得该机能充分发挥作用而避免潜在风险带来影响。
136 6
|
4月前
|
网络协议 关系型数据库 Linux
【App Service Linux】在Linux App Service中安装 tcpdump 并抓取网络包
在App Service for Linux环境中,无法像Windows一样直接使用网络排查工具抓包。本文介绍了如何通过TCPDUMP在Linux环境下抓取网络包,包括SSH进入容器、安装tcpdump、执行抓包命令及下载分析文件的完整操作步骤。
221 5
|
4月前
|
弹性计算 安全 Linux
阿里云服务器ECS安装宝塔Linux面板、安装网站(新手图文教程)
本教程详解如何在阿里云服务器上安装宝塔Linux面板,涵盖ECS服务器手动安装步骤,包括系统准备、远程连接、安装命令执行、端口开放及LNMP环境部署,手把手引导用户快速搭建网站环境。
|
11月前
|
供应链 安全 Cloud Native
阿里云飞天企业版获【可信云·容器平台安全能力】先进级认证
阿里云飞天企业版容器系列产品获中国信息通信研究院【可信云·容器平台安全能力】先进级认证,这是飞天企业版容器产品获得《等保四级PaaS平台》和《 云原生安全配置基线规范V2.0》之后,本年度再一次获得行业权威认可,证明飞天企业版的容器解决方案具备符合行业标准的最高等级容器安全能力。
326 8
阿里云飞天企业版获【可信云·容器平台安全能力】先进级认证
|
4月前
|
云安全 运维 安全
唯一全领域卓越级!阿里云飞天企业版通过安全水位最新认证
近日,阿里云与中国信息通信研究院携手,共同发布了行业首个《专有云安全水位评估》标准,为行业引入第一个专有云安全整体评估体系。在该标准指导下,阿里云以飞天企业版通过了专有云安全水位评估验证,是参评产品中唯一在全领域均取得卓越级的产品,将帮助客户实现从合规到卓越的安全能力跃迁。
165 0

相关产品

  • 云数据库 RDS MySQL 版