外网同步清华源mysql到内网搭建mysql源

外网mysql源目录主要有apt和yum目录,apt目录大小17G,yum大小99G

1.后台同步命令:会经常断,最好用脚本监控一下,断了再执行,是增量同步

nohup rsync -avz --delete rsync://mirrors.tuna.tsinghua.edu.cn/mysql/ ./ &

2.同步后把apt目录和yum目录打包传内网

3.通过nginx配置访问

4.配置服务器源文件

ubuntu系统

#ubuntu系统编译配置文件:vim /etc/apt/sources.list.d/mysql.list

Ubuntu 24.04 (noble)

deb http://192.168.1.1:8888/mysql/apt/ubuntu noble main

Ubuntu 22.04 (jammy)

deb http://192.168.1.1:8888/mysql/apt/ubuntu jammy main

Ubuntu 20.04 (focal)

deb http://192.168.1.1:8888/mysql/apt/ubuntu focal main

Ubuntu 18.04 (bionic)

deb http://192.168.1.1:8888/mysql/apt/ubuntu bionic main

#更新源

apt update
# 查看所有 MySQL Server 包版本

apt list -a mysql-server

apt list -a mysql-community-server

# 安装最新 8.0

sudo apt install mysql-server

# 安装特定版本

sudo apt install mysql-community-server=8.0.33-1ubuntu22.04

# 安装 5.7

sudo apt install mysql-community-server=5.7.44-1ubuntu20.04

centos系统

#编译配置文件:vim /etc/yum.repos.d/mysql.repo

mysql-5.7-community

name=MySQL 5.7 Community Server

baseurl=http://192.168.1.1:8888/mysql/yum/mysql-5.7-community-el7-x86_64/

gpgkey=http://192.168.1.1:8888/mysql/yum/mysql-5.7-community-el7-x86_64/RPM-GPG-KEY-mysql

gpgcheck=1

enabled=1

module_hotfixes=1

mysql-8.0-community

name=MySQL 8.0 Community Server

baseurl=http://192.168.1.1:8888/mysql/yum/mysql-8.0-community-el$releasever-$basearch/

gpgkey=http://192.168.1.1:8888/mysql/yum/mysql-8.0-community-el7-x86_64/RPM-GPG-KEY-mysql

gpgcheck=1

enabled=1

module_hotfixes=1

mysql-8.4-community

name=MySQL 8.4 Community Server

baseurl=http://192.168.1.1:8888/mysql/yum/mysql-8.4-community-el$releasever-$basearch/

gpgkey=http://192.168.1.1:8888/mysql/yum/mysql-8.4-community-el9-x86_64/RPM-GPG-KEY-mysql

gpgcheck=1

enabled=1

module_hotfixes=1

工具包(推荐启用)

mysql-connectors-community

name=MySQL Connectors Community

baseurl=http://192.168.1.1:8888/mysql/yum/mysql-connectors-community-el$releasever-$basearch/

gpgkey=http://192.168.1.1:8888/mysql/yum/mysql-connectors-community-el7-x86_64/RPM-GPG-KEY-mysql

gpgcheck=1

enabled=1

mysql-tools-community

name=MySQL Tools Community

baseurl=http://192.168.1.1:8888/mysql/yum/mysql-tools-community-el$releasever-$basearch/

gpgkey=http://192.168.1.1:8888/mysql/yum/mysql-tools-community-el7-x86_64/RPM-GPG-KEY-mysql

gpgcheck=1

enabled=1

#查看有哪些支持的mysql版本

yum --showduplicates list mysql-community-server

**#安装命令

安装 MySQL 8.0 最新版**

yum install mysql-community-server

# 安装特定版本(如 8.0.33)

yum install mysql-community-server-8.0.33

# 安装 MySQL 8.4

yum install mysql-community-server --enablerepo=mysql-8.4-community

# 或直接指定版本包

yum install mysql-community-server-8.4.2

相关推荐
jiayou641 天前
KingbaseES 表级与列级加密完全指南
数据库·后端
GBASE2 天前
G术时刻 |GBase 8s数据库事务并发控制之封锁技术介绍(下)
数据库
xiezhr2 天前
逛GitHub发现了一款免费的带AI功能的数据库管理工具
数据库·ai编程·dba
唐青枫3 天前
MySQL JSON 实战详解:从存储、查询、更新到 JSON_TABLE 与索引
sql·mysql
吃糖的小孩3 天前
给 QQ AI 机器人设计“可控记忆”:会话摘要、手动长期记忆与角色卡边界
数据库
小满8783 天前
5.Mysql事务隔离级别与锁机制
mysql
笃行3504 天前
金仓数据库数据安全双防线:静态存储加密与传输加密实战
数据库
笃行3504 天前
金仓数据库物理备份实战:sys_rman 全流程演练与误覆盖抢救
数据库
笃行3504 天前
金仓数据库逻辑备份实战:从全库导出到 Schema 替换的完整闭环
数据库
元Y亨H4 天前
技术笔记:MySQL 字符集排序规则与大小写敏感性问题解决方案
mysql