rancher 离线安装mysql
Last updated on August 24, 2025 am
🧙 Questions
使用rancher2离线安装mysql
☄️ Ideas
资源下载
docker pull --platform=linux/amd64 mysql:8.4.2
docker save -o /Users/ispong/OneDrive/Downloads/docker/mysql-8.4.2-amd64.tar mysql:8.4.2导入镜像
需要资源找我要
scp /Users/ispong/OneDrive/Downloads/docker/mysql-8.4.2-amd64.tar root@47.92.37.247:/tmpdocker load -i /tmp/mysql-8.4.2-amd64.tar
docker tag mysql:8.4.2 isxcode:8443/library/mysql:8.4.2
docker push isxcode:8443/library/mysql:8.4.2添加harbor镜像仓库
Type: Custom
Registry Domain name: isxcode:8443
Username: admin
Password: Harbor12345


创建mysql数据目录
mkdir -p /data/mysql新建deployment

创建存储
Path on Node: /data/mysql


注意Sub path不能使用绝对路径,要使用相对路径

Mount Point: /var/lib/mysql
Sub Path in Volume: data
Mount Point: /etc/mysql/conf.d
Sub Path in Volume: conf
Mount Point: /var/lib/mysql-files
Sub Path in Volume: mysql-files
配置deployment


Container Name: isxcode-mysql
Image: docker.io/library/mysql:8.4.2
Pull Policy: IfNotPresent
Pull Secrets: local-harbor

Service Type: Node Port
Name: mysql-port
Private Container Port: 3306
Protocol: TCP
Listening: 30102

Variable Name: MYSQL_ROOT_PASSWORD
Value: admin123
点击创建
访问链接
- url: jdbc:mysql://47.92.80.91:30102?useSSL=false&allowPublicKeyRetrieval=true
- username: root
- password: admin123
修改连接数
show variables like 'max_connections';
-- 设置最大连接数
set GLOBAL max_connections=2000;🔗 Links
rancher 离线安装mysql
https://ispong.isxcode.com/kubernetes/rancher/rancher 离线安装mysql/