1.在/home/smile/docker/mysql/config/目录下增加一个文件 my.cnf

# Copyright (c) , 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 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., Franklin St, Fifth Floor, Boston, MA - USA !includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/ [mysqld]
sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
lower_case_table_names=

2.删除原有的容器,新建一个

docker stop mysql
docker rm mysql
cd /home/smile/docker/mysql
docker run -p : --name mysql -v $PWD/conf/my.cnf:/etc/mysql/my.cnf -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD= -d mysql:5.7

修改docker下mysql配置的更多相关文章

  1. Ubuntu下MySql配置

    Ubuntu下MySql配置 安装MySQL 命令: sudo apt-get install mysql-server MySQL初始配置及管理 启动MySQL mysql start : mysq ...

  2. windows下mysql配置

    windows下mysql配置   忙活了大半天,总算配置好了,本文献给windows下没试用过Mysql的小白,勿喷 http://blog.csdn.net/z1074907546/article ...

  3. Windows下MySQL配置及安全加固总结

    Windows下MySQL配置及安全加固总结 在网管的实际使用过程中,MySQL数据库在安装后的配置及安全加固内容,在客户中逐渐要求越来越高.从反馈的问题看,一般都是由第三方软件公司的软件扫描整个系统 ...

  4. Docker(十七)-修改Docker容器启动配置参数

    有时候,我们创建容器时忘了添加参数 --restart=always ,当 Docker 重启时,容器未能自动启动, 现在要添加该参数怎么办呢,方法有二: 1.Docker 命令修改 docker c ...

  5. 修改Docker容器启动配置参数

    有时候,我们创建容器时忘了添加参数 --restart=always ,当 Docker 重启时,容器未能自动启动, 现在要添加该参数怎么办呢,方法有二: 1.Docker 命令修改 docker c ...

  6. Docker下MySQL的安装

    1 概述 本文讲述了如何利用Docker去安装MySQL,以及MySQL自定义配置文件的相关设置. 2 安装Docker 首先安装Docker并开启服务: systemctl start docker ...

  7. docker下MySQL的主从复制

    MySql的主从复制 sudo docker pull MySQL:5.7 拉取MySQL的镜像文件(版本号为 5.7) sudo docker run -p 3339:3306 --name mas ...

  8. Docker下mysql容器开启binlog日志(保留7天)

    现有需求开启用Docker容器启动的mysql数据库的binlog,以作为 日志记录 和 数据恢复,我们了解了MySQL的binlog日志的开启方式以及binlog日志的一些原理和常用操作,我们知道, ...

  9. bitnami下mysql配置-包含phpMyAdmin配置

    mysql开启远程访问: 默认情况下mysql的绑定ip是bind-address=127.0.0.1 找到my.cnf bitnami@linux:~$ sudo find / -name my.c ...

随机推荐

  1. shell简单脚本#1

    判断/etc/inittab文件是否大于100行,如果大于,则显示”/etc/inittab is a big file.”否者显示”/etc/inittab is a small file.” #! ...

  2. 2019icpc徐州网络赛

    A Who is better? 题意 excrt+斐波那契博弈 分析 Java的BigInteger对象默认为null,不能直接比较. 代码 import java.math.BigInteger; ...

  3. k路归并

    public static int[] k_merge(ArrayList<int[]> k_array) { if(CollectionUtils.isEmpty(k_array)){ ...

  4. Spring+Spring MVC+Hibernate框架搭建实例

    前言:这里只是说明整个搭建流程,并不进行原理性的讲解 一 下面所需要用到的数据库配置: 数据库方面,使用mysql创建一个users表,具体代码如下: 1 2 3 4 5 6 7 8 9 10 11 ...

  5. MWPhotoBrowser.bundle: bundle format unrecognized, invalid, or unsuitable

    今天在github下载了MWPhotoBrowser的demo想跑一下,却发现报了MWPhotoBrowser.bundle: bundle format unrecognized, invalid, ...

  6. ms17_0199样本测试

    一大早就各种消息弹框,于是就来测试一波 https://github.com/nixawk/metasploit-framework/blob/8ab0b448fdce15999f155dfd7b22 ...

  7. python日志汇总

    1. 文件头在Linux下推荐文件头: #! /usr/bin/env python # -*- coding: utf-8 -*- 2.import导入语句 import: 一般导入第三包可以直接使 ...

  8. 使用 gitolite 管理配置 git 库的权限

    问题:每次创建git库都需要在gitolite的配置文件中添加git库的配置信息,为了方便管理git库,不在重复提交,所以修改gitolite的配置管理文件. 环境:ubuntu16.04 安装git ...

  9. [DllImport("kernel32.dll")]使用

    C#中读取ini配置文件 [DllImport("kernel32.dll")] using System;using System.Collections.Generic;usi ...

  10. Codeforces 990 调和级数路灯贪心暴力 DFS生成树两子树差调水 GCD树连通块暴力

    A 水题 /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) using namespace ...