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

相关推荐
小陈工3 小时前
Python Web开发入门(十七):Vue.js与Python后端集成——让前后端真正“握手言和“
开发语言·前端·javascript·数据库·vue.js·人工智能·python
0xDevNull7 小时前
MySQL数据冷热分离详解
后端·mysql
科技小花7 小时前
数据治理平台架构演进观察:AI原生设计如何重构企业数据管理范式
数据库·重构·架构·数据治理·ai-native·ai原生
一江寒逸7 小时前
零基础从入门到精通MySQL(中篇):进阶篇——吃透多表查询、事务核心与高级特性,搞定复杂业务SQL
数据库·sql·mysql
D4c-lovetrain7 小时前
linux个人心得22 (mysql)
数据库·mysql
阿里小阿希8 小时前
CentOS7 PostgreSQL 9.2 升级到 15 完整教程
数据库·postgresql
荒川之神8 小时前
Oracle 数据仓库雪花模型设计(完整实战方案)
数据库·数据仓库·oracle
做个文艺程序员8 小时前
MySQL安全加固十大硬核操作
数据库·mysql·安全
不吃香菜学java8 小时前
Redis简单应用
数据库·spring boot·tomcat·maven
一个天蝎座 白勺 程序猿8 小时前
Apache IoTDB(15):IoTDB查询写回(INTO子句)深度解析——从语法到实战的ETL全链路指南
数据库·apache·etl·iotdb