GithubHelp home page GithubHelp logo

docker-mysql's Introduction

Circle CI Docker Repository on Quay.io

Table of Contents

Introduction

Dockerfile to build a MySQL container image which can be linked to other containers.

Contributing

If you find this image useful here's how you can help:

  • Send a Pull Request with your awesome new features and bug fixes
  • Help new users with Issues they may encounter
  • Support the development of this image with a donation

Reporting Issues

Docker is a relatively new project and is active being developed and tested by a thriving community of developers and testers and every release of docker features many enhancements and bugfixes.

Given the nature of the development and release cycle it is very important that you have the latest version of docker installed because any issue that you encounter might have already been fixed with a newer docker release.

For ubuntu users I suggest installing docker using docker's own package repository since the version of docker packaged in the ubuntu repositories are a little dated.

Here is the shortform of the installation of an updated version of docker on ubuntu.

sudo apt-get purge docker.io
curl -s https://get.docker.io/ubuntu/ | sudo sh
sudo apt-get update
sudo apt-get install lxc-docker

Fedora and RHEL/CentOS users should try disabling selinux with setenforce 0 and check if resolves the issue. If it does than there is not much that I can help you with. You can either stick with selinux disabled (not recommended by redhat) or switch to using ubuntu.

If using the latest docker version and/or disabling selinux does not fix the issue then please file a issue request on the issues page.

In your issue report please make sure you provide the following information:

  • The host distribution and release version.
  • Output of the docker version command
  • Output of the docker info command
  • The docker run command you used to run the image (mask out the sensitive bits).

Installation

Automated builds of the image are available on Dockerhub and is the recommended method of installation.

Note: Builds are also available on Quay.io

docker pull sameersbn/mysql:5.7.26-0

Alternately you can build the image yourself.

docker build -t sameersbn/mysql github.com/sameersbn/docker-mysql

Quick Start

Run the mysql image

docker run --name mysql -d sameersbn/mysql:5.7.26-0

You can access the mysql server as the root user using the following command:

docker run -it --rm --volumes-from=mysql sameersbn/mysql:5.7.26-0 mysql -uroot

Data Store

You should mount a volume at /var/lib/mysql.

SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux.

mkdir -p /opt/mysql/data
sudo chcon -Rt svirt_sandbox_file_t /opt/mysql/data

The updated run command looks like this.

docker run --name mysql -d \
  -v /opt/mysql/data:/var/lib/mysql sameersbn/mysql:5.7.26-0

This will make sure that the data stored in the database is not lost when the image is stopped and started again.

Creating User and Database at Launch

NOTE

For this feature to work the debian-sys-maint user needs to exist. This user is automatically created when the database is installed for the first time (firstrun).

However if you were using this image before this feature was added, then it will not work as-is. You are required to create the debian-sys-maint user

docker run -it --rm --volumes-from=mysql sameersbn/mysql \
 mysql -uroot -e "GRANT ALL PRIVILEGES on *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;"

To create a new database specify the database name in the DB_NAME variable. The following command creates a new database named dbname:

docker run --name mysql -d \
  -e 'DB_NAME=dbname' sameersbn/mysql:5.7.26-0

You may also specify a comma separated list of database names in the DB_NAME variable. The following command creates two new databases named dbname1 and dbname2

docker run --name mysql -d \
-e 'DB_NAME=dbname1,dbname2' sameersbn/mysql:5.7.26-0

To create a new user you should specify the DB_USER and DB_PASS variables.

docker run --name mysql -d \
  -e 'DB_USER=dbuser' -e 'DB_PASS=dbpass' -e 'DB_NAME=dbname' \
  sameersbn/mysql:5.7.26-0

The above command will create a user dbuser with the password dbpass and will also create a database named dbname. The dbuser user will have full/remote access to the database.

NOTE

  • If the DB_NAME is not specified, the user will not be created
  • If the user/database user already exists no changes are be made
  • If DB_PASS is not specified, an empty password will be set for the user

By default the new database will be created with the utf8 character set and utf8_unicode_ci collation. You may override these with the MYSQL_CHARSET and MYSQL_COLLATION variables.

docker run --name mysql -d \
  -e 'DB_USER=dbuser' -e 'DB_PASS=dbpass' -e 'DB_NAME=dbname' \
  -e 'MYSQL_CHARSET=utf8mb4' -e 'MYSQL_COLLATION=utf8_bin' \
  sameersbn/mysql:5.7.26-0

Creating remote user with privileged access

To create a remote user with privileged access, you need to specify the DB_REMOTE_ROOT_NAME and DB_REMOTE_ROOT_PASS variables, eg.

docker run --name mysql -d \
  -e 'DB_REMOTE_ROOT_NAME=root' -e 'DB_REMOTE_ROOT_PASS=secretpassword' \
  sameersbn/mysql:5.7.26-0

Optionally you can specify the DB_REMOTE_ROOT_HOST variable to define the address space within which remote access should be permitted. This defaults to 172.17.0.1 and should suffice for most cases.

Situations that would require you to override the default DB_REMOTE_ROOT_HOST setting are:

  • If you have changed the ip address of the docker0 interface
  • If you are using host networking, i.e. --net=host, etc.

Shell Access

For debugging and maintenance purposes you may want access the containers shell. If you are using docker version 1.3.0 or higher you can access a running containers shell using docker exec command.

docker exec -it mysql bash

If you are using an older version of docker, you can use the nsenter linux tool (part of the util-linux package) to access the container shell.

Some linux distros (e.g. ubuntu) use older versions of the util-linux which do not include the nsenter tool. To get around this @jpetazzo has created a nice docker image that allows you to install the nsenter utility and a helper script named docker-enter on these distros.

To install nsenter execute the following command on your host,

docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter

Now you can access the container shell using the command

sudo docker-enter mysql

For more information refer https://github.com/jpetazzo/nsenter

Upgrading

To upgrade to newer releases, simply follow this 3 step upgrade procedure.

  • Step 1: Stop the currently running image
docker stop mysql
  • Step 2: Update the docker image.
docker pull sameersbn/mysql:5.7.26-0
  • Step 3: Start the image
docker run --name mysql -d [OPTIONS] sameersbn/mysql:5.7.26-0

docker-mysql's People

Contributors

basic70 avatar djdefi avatar dvapelnik avatar fb avatar frank-dspeed avatar mackensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mysql's Issues

What is the easiest way to backup full db

Hi,

Thanks for this great image. I use it in connection with gitlab image you also created. I run the mysql with a data container to keep the mysql data in a data container. I am wondering what is the best way to backup the whole Database ?

Thanks a lot

why it not work?

Dear sir:
I use this command docker run -i -t --rm --link mysql:db sameersbn/mysql mysql -uroot -h db,it show errors: ERROR 1045 (28000): Access denied for user 'root'@'10.0.0.28' (using password: NO);
when I use this :docker run -i -t --rm --volumes-from=mysql sameersbn/mysql mysql -uroot, I can login to use mysql console.

I want to know what is different between two commands? thks!

DB_USER can not connect remotly

There is two problems with this installation for remote access.

  1. /etc/mysql/my.conf binds to 127.0.0.1
  2. The default user have no host associated with it.

Empty IP address

Hi, when I follow the commands to start the MySQL container/daemon:
docker run -name mysql -d sameersbn/mysql:latest
and try to get the IP address
MYSQL_IP=$(docker inspect mysql | grep IPAddres | awk -F'"' '{print $4}')
But I am receiving an empty (MYSQL_IP) address.

What am I missing?
Thanks.

Below is the full "inspect" output from mysql container:
[{
"ID": "58e2feb006a8115659e5963a18e36f380daa2ebef5f859998e9fd164d6ee6060",
"Created": "2014-07-24T11:42:06.149458819Z",
"Path": "/start",
"Args": [],
"Config": {
"Hostname": "58e2feb006a8",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"3306/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"DEBIAN_FRONTEND=noninteractive"
],
"Cmd": [
"/start"
],
"Dns": [
"8.8.8.8",
"8.8.4.4"
],
"Image": "sameersbn/mysql:latest",
"Volumes": {
"/var/lib/mysql": {}
},
"VolumesFrom": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"OnBuild": null
},
"State": {
"Running": false,
"Pid": 0,
"ExitCode": 1,
"StartedAt": "2014-07-24T11:42:06.256444663Z",
"FinishedAt": "2014-07-24T11:42:06.443349565Z",
"Ghost": false
},
"Image": "931eb2b8bba4856ee2ded254661a40b5c56b3d505c49b19670b748418dd1c827",
"NetworkSettings": {
"IPAddress": "",
"IPPrefixLen": 0,
"Gateway": "",
"Bridge": "",
"PortMapping": null,
"Ports": null
},
"ResolvConfPath": "/var/lib/docker/containers/58e2feb006a8115659e5963a18e36f380daa2ebef5f859998e9fd164d6ee6060/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/58e2feb006a8115659e5963a18e36f380daa2ebef5f859998e9fd164d6ee6060/hostname",
"HostsPath": "/var/lib/docker/containers/58e2feb006a8115659e5963a18e36f380daa2ebef5f859998e9fd164d6ee6060/hosts",
"Name": "/trusting_mclean",
"Driver": "aufs",
"ExecDriver": "native-0.1",
"Volumes": {
"/var/lib/mysql": "/var/lib/docker/vfs/dir/21b0edbba3d0a376db035c91b4484560db388c61cf8f9f56dd75191242214a9d"
},
"VolumesRW": {
"/var/lib/mysql": true
},
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LxcConf": [],
"Privileged": false,
"PortBindings": {
"3306/tcp": null
},
"Links": null,
"PublishAllPorts": false
}
}]

Version '5.7.26*' for 'mysql-server' was not found in ubuntu:bionic-20190612

It seems there is an issue with the mysql-server current version in the docker file because building an image give the following error.

E: Version '5.7.26*' for 'mysql-server' was not found

I have found on the official website that 5.7.26 is not available to download rather 5.7.28 is available. So, I have changed the version to MYSQL_VERSION=5.7.28 it worked flawlessly.


Docker host: CentOS 7
Docker version: 19.03.5

[user@hostname]$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 11
  Running: 0
  Paused: 0
  Stopped: 11
 Images: 78
 Server Version: 19.03.5
 Storage Driver: devicemapper
  Pool Name: docker-259:1-1668633-pool
  Pool Blocksize: 65.54kB
  Base Device Size: 10.74GB
  Backing Filesystem: xfs
  Udev Sync Supported: true
  Data file: /dev/loop0
  Metadata file: /dev/loop1
  Data loop file: /var/lib/docker/devicemapper/devicemapper/data
  Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
  Data Space Used: 3.706GB
  Data Space Total: 107.4GB
  Data Space Available: 9.403GB
  Metadata Space Used: 24.09MB
  Metadata Space Total: 2.147GB
  Metadata Space Available: 2.123GB
  Thin Pool Minimum Free Space: 10.74GB
  Deferred Removal Enabled: true
  Deferred Deletion Enabled: true
  Deferred Deleted Device Count: 0
  Library Version: 1.02.158-RHEL7 (2019-05-13)
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1062.7.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.758GiB
 Name: hostname
 ID: 6DJA:WYXO:337B:WV53:Y7BX:VGYO:M3MP:ZRAL:N3AA:SLKG:MWSV:O4EB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Latest mysql image having issue with gitlab

@sameersbn and team
Kindly have a look at #sameersbn/docker-gitlab#1486
After docker-compose pull, I am getting the following error

mysql_1   | Creating database "gitlabhq_production"...
mysql_1   | Granting access to database "gitlabhq_production" for user "gitlab"...
mysql_1   | ERROR 3009 (HY000) at line 1: Column count of mysql.user is wrong. Expected 45, found 42. Created with MySQL 50554, now running 50721. Please use mysql_upgrade to fix this error.

Freezes @ "mysqld_safe Starting mysqld daemon with databases from /var/lib/my"sql

Hello! I'm trying to create a Dockerfile that needs a MYSQL instance running on it. I'm fairly new to Docker in general, so apologizes in advance if I'm presenting some bad practices in here.

While trying to build the container it freezes (I killed after 8 minutes) on that last step. I tried to comment out the SQL creation of sys-main user but it just gave me another error.


Command ran: sudo docker-compose up
Output:

Step 12/15 : RUN /sbin/entrypoint.sh
 ---> Running in 0f30e5e37142
Installing database...
Starting MySQL server...
Waiting for database server to accept connections.
Creating debian-sys-maint user...
2019-04-04T00:50:10.890047Z mysqld_safe Logging to syslog.
2019-04-04T00:50:10.940056Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

Dockerfile (omiting non-relevant parts):

FROM tloriato/multichain-node:2.1.0
MAINTAINER tloriato

USER root

COPY entrypoint.sh /sbin/entrypoint.sh

ENV MYSQL_USER=mysql \
    MYSQL_VERSION=5.7 \
    MYSQL_DATA_DIR=/var/lib/mysql \
    MYSQL_RUN_DIR=/run/mysqld \
    MYSQL_LOG_DIR=/var/log/mysql

RUN apt-get update \
        && apt-get dist-upgrade \
        && DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server-${MYSQL_VERSION} \
        && rm -rf ${MYSQL_DATA_DIR} \
        && rm -rf /var/lib/apt/lists/* \
        /etc/init.d/mysql start

# run with a few apt-get things in here

RUN chmod 755 /sbin/entrypoint.sh

# run with some unzipping 

# run installing python

ADD ./runexplorer.sh /root/runexplorer.sh
RUN /sbin/entrypoint.sh # I changed from ENTRYPOINT because the other one wasn't running!
RUN chmod a+x /root/runexplorer.sh

EXPOSE 3306/tcp

CMD ["/bin/bash", "/root/runexplorer.sh"]

docker-compose.yml (relevant parts only):

version: '2'
services:
    explorernode:
        build: ./explorer
        stdin_open: true
        tty: true
        expose:
            - 7557
            - 8002
        ports:
            - "3306:3306"
        environment:
            DB_NAME: abe
            DB_USER: abe
            DB_PASS: PASSWORD
            DB_REMOTE_ROOT_NAME: remote-user
            DB_REMOTE_ROOT_PASS: remote-password
        links:
            - masternode
        depends_on:
            - masternode

Upgrade from very old docker image

I have a very old image that was installed using the :latest tag

I am trying to take it up to something more recent, however with all the tags that I found on docker hub I have this error message (version is different with different tags):

ERROR 3009 (HY000) at line 1: Column count of mysql.user is wrong. Expected 45, found 42. Created with MySQL 50554, now running 50724. Please use mysql_upgrade to fix this error.

I am unable to run the mysql_upgrade command inside the docker container because the image stops.

There is an easy way for recover this situation?
Question: shouldn't the mysql_upgrade taken into consideration when mysql version changes?

Thank you in advance

Access denied for user 'root'@'localhost' (using password: NO)

thank you for this image.
i avoided using this image with docker-compose just to avoid the hassle of configuring remote access, so i combined this image with my own image in dockerfile like this:

ENV MYSQL_USER=mysql \
    MYSQL_DATA_DIR=/var/lib/mysql \
    MYSQL_RUN_DIR=/run/mysqld \
    MYSQL_LOG_DIR=/var/log/mysql

RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server \
 && rm -rf ${MYSQL_DATA_DIR} \
 && rm -rf /var/lib/apt/lists/*

COPY mysql_entrypoint.sh /sbin/mysql_entrypoint.sh

and i start mysql server from supervisord:

[program:mysql]
command=/sbin/mysql_entrypoint.sh
autostart=true
autorestart=true

this is used to work, but docker crashed and after recreating the image i can't connect to mysql, it's asking for password
if there is a password what it is?:

additional info:
docker image: ubuntu:16.04
using docker for windows

Error with `docker-compose.yml`

I have tried it with docker-cmd-line like docker run -ti -e .... and run well, but run bad with docker-compose

My-docker-compose

  mysql:
    container_name: mysql-server
    image: 'sameersbn/mysql:5.7.22-1'
    restart: always
    container_name: mysql
    volumes:
      - /srv/docker/data/mysqldata:/var/lib/mysql
    ports:
      - '3306:3306'
    environment:
     - DB_USER=admin007
     - DB_PASS=myadmin@816
     - DB_NAME=djsite
     - DB_REMOTE_ROOT_NAME=root
     - DB_REMOTE_ROOT_PASS=meigea@123
     - MYSQL_CHARSET=utf8mb4
     - MYSQL_COLLATION=utf8_bin

the log of Error

mysql exited with code 1
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
mysql          | Creating database "djsite"...
mysql          | ERROR 1253 (42000) at line 1: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'

How to edit my.conf

Hi there,
I want to add some config to my.conf but "command not found".
So i need to install an editor like: vi, vim, nano but can't.
Can you help me check this..

is ist safe to use this command while the "mysql" container is running?

Hello

You write in the docu

You can access the mysql server as the root user using the following command:

docker run -it --rm --volumes-from=mysql sameersbn/mysql:latest mysql -uroot

im aware that you retrieve the socket from the mysql-volume /run/mysqld. im just not sure if its safe to use this socket in two containers. maybe you can enlight me with some detailed explanation.

thanks in advance

Link to Mysql container from other container

Hello y launch a container mysql and i try to link to other container with apache and php, i want use phpmyadmin to see the databases ono mysql container, i launch and link the containers but phpmyadmin cant connect with mysql

"Start" should discover the ip range

Some of us need to change docker0 default network from 172.17.* to something else (like 192.168.*).

The "start" script could find out the network range in order not to hard code the granted permission on the database. Or maybe accept another value from a environment variable.

Cannot get into the docker "Can't connect"

Trying to get a shell in the docker using

docker run -it --rm --volumes-from=mysql sameersbn/mysql:latest mysql -uroot

causes

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Data store

I'm doing some test and i fall in truble.
If i create a table in mysql container and stop and then restart the table is still there.
I except that my table isn't there.
So my question is, why use data store? Could be some data loss?
Thanks

Upgraded now container crashes on startup

I am getting the bellow error over and over I have tried stating a fresh container with no databases tried using my old databases and the same thing happens, I have tried deleting log files as suggested on a forum but no change, I have downloaded a new image I even tried building it myself can't find anyone with this issue in a docker container.

141213 16:17:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[Suggestion] Create multiple databases if DB_NAME is an array of names

Would it be possible to modify this image to accept a comma-separated array to DB_NAME?

Such as: -e DB_NAME=dbname1,dbname2,dbname3

We have a use case where we have a Dockerized web application that needs to connect to about 5 different MySQL databases, and would like to only run a single MySQL container on our dev machines (via fig)

Cannot run image

Using the example from the readme:

docker run --name mysql -d \
  -e 'DB_NAME=dbname' sameersbn/mysql:latest

Results:

# docker logs mysql
Installing database...
Could not connect to mysql server. Aborting...

Seems to be a permissions error on /tmp/:

root@core01:~# docker run --name mysql -it -e 'DB_NAME=dbname' sameersbn/mysql:latest bash
/root@bcefdfcb16b1:/# chmod 777 /tmp
root@bcefdfcb16b1:/# /sbin/entrypoint.sh &
[1] 25
root@bcefdfcb16b1:/# Installing database...
Starting MySQL server...
Waiting for database server to accept connections..
Creating debian-sys-maint user...
Creating database "dbname"...
151001 06:52:13 mysqld_safe Logging to syslog.
151001 06:52:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root@bcefdfcb16b1:/# ps -ejHf
UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root         1     0     1     1  0 06:51 ?        00:00:00 bash
root        25     1    25     1  0 06:52 ?        00:00:00   /bin/sh /usr/bin/mysqld_safe
mysql     1228    25    25     1  1 06:52 ?        00:00:00     /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
root      1229    25    25     1  0 06:52 ?        00:00:00     logger -t mysqld -p daemon.error
root      1247     1  1247     1  0 06:52 ?        00:00:00   ps -ejHf
root@bcefdfcb16b1:/#

And without the chmod step:

root@core01:~# docker run --name mysql -it -e 'DB_NAME=dbname' sameersbn/mysql:latest bash
root@fae184744de6:/# /sbin/entrypoint.sh &
[1] 25
root@fae184744de6:/# Installing database...

[1]+  Exit 1                  /sbin/entrypoint.sh
root@fae184744de6:/# /sbin/entrypoint.sh &
[1] 84
Could not connect to mysql server. Aborting...

[1]+  Exit 1                  /sbin/entrypoint.sh
root@fae184744de6:/#

I'm using Docker version 1.7.1, build 786b29d

DB backup

I have simply started mysql with following command for Redmine
docker run --name=mysql -d -e 'DB_NAME=redmine_production' -e 'DB_USER=redmine' -e 'DB_PASS=password' sameersbn/mysql:latest

I have not used --volume.
But now i need backup of database because I can not afford loosing database.
Plz help. How can i do it?

Question about the value of max_binlog_cache_size

Thanks for providing this useful container.

I am doing a research aiming at finding issues in configuration files. I have a question about one MySQL config: max_binlog_cache_size. It seems the official document says "The maximum recommended value is 4GB; this is due to the fact that MySQL currently cannot work with binary log positions greater than 4GB."

However, the default value is 18446744073709551615, which is much larger than the recommended value.

Shall we change the value to 4GB?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.