首页 > 数据库 >docker安装mysql8.0

docker安装mysql8.0

时间:2022-08-20 00:34:31浏览次数:67  
标签:mysql8 data etc mysql8.0 mysql var -- docker 安装

docker run \
    -p 3306:3306 \
    -e MYSQL_ROOT_PASSWORD=QQ.123 \
    -v /home/data/mysql8/data:/var/lib/mysql:rw \
    -v /home/data/mysql8/log:/var/log/mysql:rw \
    -v /home/data/mysql8/config/my.cnf:/etc/mysql/my.cnf:rw \
    -v /etc/localtime:/etc/localtime:ro \
    --name mysql8 \
    --restart=always \
    -d mysql:8.0

my.cnf

# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
secure-file-priv= NULL

# 设置忽略大小写,设置后数据库无法启动
# lower_case_table_names=1

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Custom config should go here
!includedir /etc/mysql/conf.d/

default_authentication_plugin= mysql_native_password

忽略大小写

docker run \
    -p 3308:3306 \
    -e MYSQL_ROOT_PASSWORD=QQ.123 \
    -v /home/data/mysql8-ignorecase/config/my.cnf:/etc/mysql/my.cnf:rw \
    -v /home/data/mysql8-ignorecase/data:/var/lib/mysql:rw \
    -v /etc/localtime:/etc/localtime:ro \
    --name mysql8-ignorecase \
    --restart=always \
    -d ncp-kms-registry:5000/mysql:8.0 \
    --lower_case_table_names=1

标签:mysql8,data,etc,mysql8.0,mysql,var,--,docker,安装
From: https://www.cnblogs.com/jiftle/p/16606981.html

相关文章

  • Python PyInstaller安装和使用教程(详解版)
    在创建了独立应用(自包含该应用的依赖包)之后,还可以使用PyInstaller将 Python 程序生成可直接运行的程序,这个程序就可以被分发到对应的Windows或MacOSX平台上运行......
  • windows 安装 Anaconda3
    1.准备工作:下载软件anaconda官网下载地址:https://www.anaconda.com/products/distribution#Downloads 我下载的最新的安装包,下载链接: https://repo.an......
  • centos常用命令及软件安装
    常用命令pwd查看当前所在目录free-h查看内存使用情况df-lh查看磁盘空间使用情况uname-a查看系统版本nohub[命令]&后台运行ps-ef|grep[关键字]查看相关进程的......
  • centos7安装nginx
    1、解压tar-zxvfnginx.tar.gz2、进入解压后的文件cdnginx3、执行configure文件./configure可能会有报错:./configure:error:theHTTPgzipmodulerequiresth......
  • conda自动安装cpu版本pytorch
    问题描述由于conda自带的源太慢,换成了清华源,结果无论怎么下载都无法使用cuda。检查conda列表发现装的是cpu版本原因网上众说纷纭,例如删掉cpu-only包,但都是瞎猫碰上死耗......
  • docker构建pytorch
    配置拉取镜像(devel版本有nvcc和cudnn)sudodockerpullpytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel构建容器阿立dockerrun-it--gpusall--namelipytorch1.6-......
  • Jenkins+gitlab+docker+harbor容器化自动部署详细流程
    环境:Linux版本:Centos7一、更新源:yumupdate二、安装docker:yuminstalldocker-y启动docker:systemctlstartdocker三、.安装gitlab1.docker......
  • Mac电脑怎么安装Jmeter
    一、Jmeter简介ApacheJMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试,它最初被设计用于Web应用测试,但后来扩展到其他测试领域。目前也是测试领......
  • docker搭建phpswoole实现http服务
    一、创建DockerfileFROMphpswoole/swoole#COPY./www//var/www/二、同级目录下创建docker-composer.yamlservices:phpswoole-server:container_name:p......
  • Ubuntu安装openssl
    wgethttps://www.openssl.org/source/old/1.1.1/openssl-1.1.1.tar.gztarxvfopenssl-1.1.1.tar.gzcdopenssl-1.1.1./configno-asmsharedno-async--prefix=/usr--c......