首页 > 数据库 >docker部署mysql

docker部署mysql

时间:2024-04-17 16:35:54浏览次数:35  
标签:部署 mysql5.7 mysql8 conf mysql docker data

docker部署mysql

mkdir -p /data/docker/mysql5.7/{data,conf.d}
mkdir -p /data/docker/mysql8/{data,conf.d}
version: '3'
services:

  mysql_5.7:
   image: mysql:5.7.40
   restart: always
   ports:
    - 13306:3306
   environment:
    - MYSQL_ROOT_PASSWORD=password
   volumes:
    - /data/docker/mysql5.7/data:/var/lib/mysql
    - /data/docker/mysql5.7/conf.d:/etc/mysql/conf.d

  mysql_8.0:
   image: mysql:8.0.31
   restart: always
   ports:
    - 23306:3306
   environment:
    - MYSQL_ROOT_PASSWORD=password
   volumes:
    - /data/docker/mysql8/data:/var/lib/mysql
    - /data/docker/mysql8/conf.d:/etc/mysql/conf.d

标签:部署,mysql5.7,mysql8,conf,mysql,docker,data
From: https://www.cnblogs.com/wszzn/p/18141081

相关文章

  • docker部署redis
    拉取镜像dockerpullredis:6.2.6创建映射目录和文件mkdir-p/data/server/docker_redis/data官网下载对应版本redis.conf,放在/data/server/docker_redis/目录下运行redisdockerrun-d-p6379:6379--name=redis--privileged=true-v/data/server/docker_redis/redis.c......
  • mysql主从升级(直接先升级主库,旧binlog拷贝到新版本目录,需要停业务)
    环境:OS:Centos7旧版本:mysql5.6新版本:mysql5.71.停掉旧版本数据库确保主从当前没有延迟再停主库,不过有延迟也可以停掉查看从库的状态mysql>showslavestatus\G;***************************1.row***************************Slave_IO_State:Wai......
  • docker compose部署一个ubuntu桌面环境
    dockercompose部署一个ubuntu桌面环境version:"3"services:ubuntu-d:container_name:ubuntu-dimage:dorowu/ubuntu-desktop-lxde-vnchostname:ubuntu_dports:-50080:80-55900:5900restart:on-failure:3volumes:......
  • docker compose部署nginx-proxy-manager
    dockercompose部署nginx-proxy-managerdocker-compose.yamlversion:'3'services:npm:image:jc21/nginx-proxy-manager:latestcontainer_name:npmrestart:alwaysenvironment:-TZ=Asia/Shanghaiports:-'30080......
  • docker compose部署nextcloud
    dockercompose部署nextcloudversion:'3'services:nextcloud:image:nextcloudcontainer_name:nextcloudenvironment:-MYSQL_HOST=nextcloud-db-MYSQL_DATABASE=nextcloud-MYSQL_USER=nextcloud-MYSQL_PASSWOR......
  • docker部署jenkins.md
    拉取镜像dockerpulljenkins/jenkins创建映射目录mkdir-p/mydata/jenkins_home创建容器dockerrun-d-p28080:8080-v/mydata/jenkins_home:/var/jenkins_home-v/etc/localtime:/etc/localtime--restart=on-failure:3--namejenkins01jenkins/jenkins:latestdoc......
  • docker部署mongodb
    docker部署mongodb拉取镜像dockerpullmongo启动mongo(dockerrun和dockercompose)dockerrun--auth:需要密码才能访问容器服务。-eMONGO_INITDB_ROOT_USERNAME:设置用户名-eMONGO_INITDB_ROOT_PASSWORD:设置密码dockerrun--restart=always--namemongodb-v~/dock......
  • MySQL8 设置大小写敏感
    https://blog.csdn.net/xhmico/article/details/136680013今天对我本地的数据库迁移服务器上,完成之后启动项目报错 说数据库中不存在quartz_LOCKS这张表 我打开服务器上面的数据上面展示的表名是quartz_LOCKS,然后通过查询lower_case_table_names配置可知showvariabl......
  • mysql复制数据库
    mysql复制数据库,导出导入方法一:使用mysqldump创建新的数据库createdatabasenew_db同一个mysql服务器复制数据库方法mysqldumpold_db-u账户-p密码|mysql-P端口new_db-u账户-p密码不同mysql服务器复制数据库方法mysqldumpold_db-u账户-p密码|m......
  • mysql小版本升级(yg)
    mysql小版本升级两种方式:In-PlaceUpgradeLogicalUpgrade[In-PlaceUpgrade](#in-placeupgrade)​ 原地升级(In-PlaceUpgrade:直接替换二进制文件(即直接yumupdate/rpm-Uvh升级rpm包)数据库目录等都不变。LogicalUpgrade​ 逻辑升级(LogicalUpgrade):先用mysqldump......