外网同步清华源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

相关推荐
李广坤13 小时前
MySQL 大表字段变更实践(改名 + 改类型 + 改长度)
数据库
Turnip12022 天前
深度解析:为什么简单的数据库"写操作"会在 MySQL 中卡住?
后端·mysql
爱可生开源社区2 天前
2026 年,优秀的 DBA 需要具备哪些素质?
数据库·人工智能·dba
随逸1772 天前
《从零搭建NestJS项目》
数据库·typescript
加号32 天前
windows系统下mysql多源数据库同步部署
数据库·windows·mysql
シ風箏2 天前
MySQL【部署 04】Docker部署 MySQL8.0.32 版本(网盘镜像及启动命令分享)
数据库·mysql·docker
李慕婉学姐2 天前
Springboot智慧社区系统设计与开发6n99s526(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端
百锦再2 天前
Django实现接口token检测的实现方案
数据库·python·django·sqlite·flask·fastapi·pip
WeiXin_DZbishe2 天前
基于django在线音乐数据采集的设计与实现-计算机毕设 附源码 22647
javascript·spring boot·mysql·django·node.js·php·html5
tryCbest2 天前
数据库SQL学习
数据库·sql