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

相关推荐
袋鼠云数栈8 小时前
让 SQL 解析不再重复造轮子:SqlParserX 正式开源
数据库·人工智能·sql·开源·数据治理
这个DBA有点耶8 小时前
期货 CTP 系统 Oracle RAC 迁移国产库实战:读写分离架构设计与性能对标
数据库·架构·dba
数据库安全8 小时前
AI数据访问安全 |如何控制AI访问权限,防止越权
数据库·安全
小羊没烦恼!9 小时前
异步编程:线程概述及使用
java·开发语言·mysql·算法·c#
这个DBA有点耶9 小时前
Redo Log循环写与checkpoint推进:长事务阻塞下的Checkpoint风暴完整链路
数据库·mysql·代码规范
jnrjian9 小时前
pg_waldump --key-file-name status 查看wal 产生的db
数据库
SelectDB技术团队10 小时前
Snowflake 的开源替代怎么选:能力对照、三条部署路径与迁移执行
大数据·数据库·云原生·开源·snowflake·apache doris
Elastic 中国社区官方博客10 小时前
告别繁琐控制台:Kabanos 如何将 MongoDB Compass 的易用性带入 Elasticsearch
大数据·数据库·mongodb·elasticsearch·搜索引擎·全文检索
京东云开发者10 小时前
当我谈数据库高可用时我谈些什么
数据库
梦影_10 小时前
MySQL进阶教程(一)—— 储存过程与触发器(上)
开发语言·数据库·后端·sql·mysql·中间件