Git Product home page Git Product logo

mysql's Introduction

This is the Git repo of the Docker "Official Image" for mysql (not to be confused with any official mysql image provided by mysql upstream). See the Docker Hub page for the full readme on how to use this Docker image and for information regarding contributing and issues.

The full image description on Docker Hub is generated/maintained over in the docker-library/docs repository, specifically in the mysql directory.

See a change merged here that doesn't show up on Docker Hub yet?

For more information about the full official images change lifecycle, see the "An image's source changed in Git, now what?" FAQ entry.

For outstanding mysql image PRs, check PRs with the "library/mysql" label on the official-images repository. For the current "source of truth" for mysql, see the library/mysql file in the official-images repository.


  • build status badge
  • build status badge
Build Status Badges (per-arch)
amd64 build status badge arm64v8 build status badge put-shared build status badge

mysql's People

Contributors

d3vil-st avatar docker-library-bot avatar gierschv avatar giggsoff avatar glensc avatar hectorm avatar ioggstream avatar istador avatar j0wi avatar jnoordsij avatar kototoyo avatar lalyos avatar laurentgoderre avatar lrf141 avatar ltangvald avatar marc-mabe avatar mwcampbell avatar peterknealenearmap avatar phemmer avatar rawr51919 avatar sherter avatar silentroach avatar sootysec avatar tianon avatar timwolla avatar vincentchalamon avatar woutersamaey avatar wpalmer avatar yosifkit avatar zhangguanzhang 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  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

mysql's Issues

Updates to the image information/docs page

I'd like to propose a couple of changes to the Information page for these images:

  1. The logo is outdated. This is the correct one these days: http://www.mysql.com/common/logos/logo-mysql-170x115.png
  2. Change the “What is MySQL?” section to something like this, which I believe is a bit more to-the-point and more centered on MySQL itself:

What is MySQL?

MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via online shops and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more.

For more information and related downloads for MySQL Server and other MySQL products, please visit www.mysql.com.

Container does not catch signals and exit (Ctrl+C)

If I start a database like this:

/usr/bin/docker run --name database -e MYSQL_ROOT_PASSWORD=whatever mysql:5.6

The container does not respond to Ctrl+c like most containers do - it simply will not exit until I manually kill the process from a different terminal.

Even if I add "-it" options, it is still the same.

This is on docker 1.4.1.

Other containers exhibit the expected behavior on the same docker version.

mysql:5.5 cannot be pulled with docker 1.5

Since today, we end up with an error when pulling mysql:5.5 via our private registry (v0.9.1) or docker 1.5 directly.

Note: When pulling the image directly from registry-1.docker.io with docker 1.6, it works!

So a workaround is to upgrade all our machines to docker 1.6. Unfortunately, the docker registry still isn't able to mirror that image.

Error log on client side:

core@coreos ~ $ docker pull docker.bosch-si.com:5000/mysql:5.5
Pulling repository docker.bosch-si.com:5000/mysql
806951c10f4d: Error pulling image (5.5) from docker.bosch-si.com:5000/mysql, HTTP code 404
8ebbde154a62: Download complete
c12da83ee7c1: Download complete
a16207605ac6: Error pulling dependent layers
FATA[0019] Error pulling image (5.5) from docker.bosch-si.com:5000/mysql, HTTP code 404

From the registry log:

15/Jun/2015:08:42:41 +0000 DEBUG: args = {'image_id': u'a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757'}
15/Jun/2015:08:42:41 +0000 DEBUG: api_error: Image not found
15/Jun/2015:08:42:41 +0000 DEBUG: Source provided, registry acts as mirror
15/Jun/2015:08:42:41 +0000 DEBUG: Request: GET https://registry-1.docker.io/v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json
Headers: {'Accept-Encoding': u'gzip', 'Authorization': u'Token signature=1a6282cb325ff863dc8038f5688355f92eab29b1,repository="library/mysql",access=read', 'User-Agent': u'docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64'}
Args: ImmutableMultiDict([])
15/Jun/2015:08:42:41 +0000 INFO: Starting new HTTPS connection (1): registry-1.docker.io
15/Jun/2015:08:42:41 +0000 DEBUG: "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 400 49
15/Jun/2015:08:42:41 +0000 DEBUG: Source responded to request with non-200 status
15/Jun/2015:08:42:41 +0000 DEBUG: Response: 400
{"error": "Image is being uploaded, retry later"}

10.55.35.233 - - [15/Jun/2015:08:42:41 +0000] "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 404 28 "-" "docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64"
15/Jun/2015:08:42:42 +0000 DEBUG: args = {'image_id': u'a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757'}
15/Jun/2015:08:42:42 +0000 DEBUG: api_error: Image not found
15/Jun/2015:08:42:42 +0000 DEBUG: Source provided, registry acts as mirror
15/Jun/2015:08:42:42 +0000 DEBUG: Request: GET https://registry-1.docker.io/v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json
Headers: {'Accept-Encoding': u'gzip', 'Authorization': u'Token signature=1a6282cb325ff863dc8038f5688355f92eab29b1,repository="library/mysql",access=read', 'User-Agent': u'docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64'}
Args: ImmutableMultiDict([])
15/Jun/2015:08:42:42 +0000 INFO: Starting new HTTPS connection (1): registry-1.docker.io
15/Jun/2015:08:42:43 +0000 DEBUG: "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 400 49
15/Jun/2015:08:42:43 +0000 DEBUG: Source responded to request with non-200 status
15/Jun/2015:08:42:43 +0000 DEBUG: Response: 400
{"error": "Image is being uploaded, retry later"}

10.55.35.233 - - [15/Jun/2015:08:42:43 +0000] "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 404 28 "-" "docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64"
15/Jun/2015:08:42:44 +0000 DEBUG: args = {'image_id': u'a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757'}
15/Jun/2015:08:42:44 +0000 DEBUG: api_error: Image not found
15/Jun/2015:08:42:44 +0000 DEBUG: Source provided, registry acts as mirror
15/Jun/2015:08:42:44 +0000 DEBUG: Request: GET https://registry-1.docker.io/v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json
Headers: {'Accept-Encoding': u'gzip', 'Authorization': u'Token signature=1a6282cb325ff863dc8038f5688355f92eab29b1,repository="library/mysql",access=read', 'User-Agent': u'docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64'}
Args: ImmutableMultiDict([])
15/Jun/2015:08:42:44 +0000 INFO: Starting new HTTPS connection (1): registry-1.docker.io
15/Jun/2015:08:42:45 +0000 DEBUG: "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 400 49
15/Jun/2015:08:42:45 +0000 DEBUG: Source responded to request with non-200 status
15/Jun/2015:08:42:45 +0000 DEBUG: Response: 400
{"error": "Image is being uploaded, retry later"}

10.55.35.233 - - [15/Jun/2015:08:42:45 +0000] "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 404 28 "-" "docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64"
15/Jun/2015:08:42:46 +0000 DEBUG: args = {'image_id': u'a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757'}
15/Jun/2015:08:42:46 +0000 DEBUG: api_error: Image not found
15/Jun/2015:08:42:46 +0000 DEBUG: Source provided, registry acts as mirror
15/Jun/2015:08:42:46 +0000 DEBUG: Request: GET https://registry-1.docker.io/v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json
Headers: {'Accept-Encoding': u'gzip', 'Authorization': u'Token signature=1a6282cb325ff863dc8038f5688355f92eab29b1,repository="library/mysql",access=read', 'User-Agent': u'docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64'}
Args: ImmutableMultiDict([])
15/Jun/2015:08:42:46 +0000 INFO: Starting new HTTPS connection (1): registry-1.docker.io
15/Jun/2015:08:42:47 +0000 DEBUG: "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 400 49
15/Jun/2015:08:42:47 +0000 DEBUG: Source responded to request with non-200 status
15/Jun/2015:08:42:47 +0000 DEBUG: Response: 400
{"error": "Image is being uploaded, retry later"}

10.55.35.233 - - [15/Jun/2015:08:42:47 +0000] "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 404 28 "-" "docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64"
15/Jun/2015:08:42:49 +0000 DEBUG: args = {'image_id': u'a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757'}
15/Jun/2015:08:42:49 +0000 DEBUG: api_error: Image not found
15/Jun/2015:08:42:49 +0000 DEBUG: Source provided, registry acts as mirror
15/Jun/2015:08:42:49 +0000 DEBUG: Request: GET https://registry-1.docker.io/v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json
Headers: {'Accept-Encoding': u'gzip', 'Authorization': u'Token signature=1a6282cb325ff863dc8038f5688355f92eab29b1,repository="library/mysql",access=read', 'User-Agent': u'docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64'}
Args: ImmutableMultiDict([])
15/Jun/2015:08:42:49 +0000 INFO: Starting new HTTPS connection (1): registry-1.docker.io
15/Jun/2015:08:42:50 +0000 DEBUG: "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 400 49
15/Jun/2015:08:42:50 +0000 DEBUG: Source responded to request with non-200 status
15/Jun/2015:08:42:50 +0000 DEBUG: Response: 400
{"error": "Image is being uploaded, retry later"}

10.55.35.233 - - [15/Jun/2015:08:42:50 +0000] "GET /v1/images/a16207605ac67b9cf0ff3c9ff208d276a9e2020bfa545a80be9ddb9911104757/json HTTP/1.1" 404 28 "-" "docker/1.6.0 go/go1.4.2 git-commit/4749651 kernel/3.16.0-30-generic os/linux arch/amd64"

Container with MySQL crash almost every day

One of the multiple containers i have is a MySQL database but i have this stability problem. Almost every day the container is down and i have to restart it.

I've been looking in the logs for some clue about the problem but i didn't found anything.

I have containers with nginx and wordpress and i don't have any problem.

I can provide whatever log you need.

Thank you :)

Cannot launch image with a mapped data directory.

My complete script to reproduce is here: https://gist.github.com/c10bc18fbebc77cb00e1

When using the -v /data/path/to/mysql:/var/lib/mysql, I'm getting the following error shown below using Kitematic's docker shell. Omitting the -v argument permits the image to run. Not sure how to use this image with an externally mapped data directory.

Log

2015-04-29 16:46:11 0 [Note] mysqld (mysqld 5.6.24) starting as process 1 ...
2015-04-29 16:46:11 1 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2015-04-29 16:46:11 1 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2015-04-29 16:46:11 1 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-04-29 16:46:11 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-04-29 16:46:11 1 [Note] InnoDB: The InnoDB memory heap is disabled
2015-04-29 16:46:11 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-04-29 16:46:11 1 [Note] InnoDB: Memory barrier is not used
2015-04-29 16:46:11 1 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-04-29 16:46:11 1 [Note] InnoDB: Using Linux native AIO
2015-04-29 16:46:11 1 [Note] InnoDB: Not using CPU crc32 instructions
2015-04-29 16:46:11 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-04-29 16:46:11 1 [Note] InnoDB: Completed initialization of buffer pool
2015-04-29 16:46:11 7f0e64972720  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
2015-04-29 16:46:11 7f0e64972720  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
2015-04-29 16:46:11 1 [ERROR] InnoDB: Creating or opening ./ibdata1 failed!
2015-04-29 16:46:11 1 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-04-29 16:46:11 1 [ERROR] Plugin 'InnoDB' init function returned error.
2015-04-29 16:46:11 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-04-29 16:46:11 1 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-04-29 16:46:11 1 [ERROR] Aborting

2015-04-29 16:46:11 1 [Note] Binlog end
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'partition'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'BLACKHOLE'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'ARCHIVE'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_METRICS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_CMP'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'INNODB_TRX'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'MEMORY'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'CSV'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'MRG_MYISAM'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'MyISAM'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'sha256_password'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'mysql_old_password'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'mysql_native_password'
2015-04-29 16:46:11 1 [Note] Shutting down plugin 'binlog'
2015-04-29 16:46:11 1 [Note] mysqld: Shutdown complete

Try to load sample data Sakila failed

Hi,

This is not an issue with your script but I failed to make an enhancement. I want to load Sample data, Sakila (http://dev.mysql.com/doc/sakila/en/index.html) when the image run.

I added few lines in entrypoint.sh of both 5.6 and 5.7 sub directory

echo 'FLUSH PRIVILEGES ;' >> "$TEMP_FILE"

if [ "$MYSQL_SAKILA" ]; then
    SCHEMA_FILE='/tmp/sakila-db/sakila-schema.sql'
    DATA_FILE='/tmp/sakila-db/sakila-data.sql'

    cat "$SCHEMA_FILE" >> "$TEMP_FILE"
    cat "$DATA_FILE" >> "$TEMP_FILE"
fi
set -- "$@" --init-file="$TEMP_FILE"

fi

chown -R mysql:mysql /var/lib/mysql
exec "$@"

the newly added sql files loaded, but partly only and logs show:

2014-09-26 17:51:49 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' started.
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER ;;' at line 1
2014-09-26 17:51:49 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' ended.

the same files can be loaded successfully from in mysql shell
source /tmp/sakila-db/sakila-schema.sql;
source /tmp/sakila-db/sakila-data.sql;

do you know any reason?

Will not even start

Hm. This container worked well until this afternoon, then I started getting error messages like this:

 hlrdb_1 | 2014-10-31 16:59:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
 hlrdb_1 | 2014-10-31 16:59:24 1 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
 hlrdb_1 | 
 hlrdb_1 | 2014-10-31 16:59:24 1 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)
 hlrdb_1 | 
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] Plugin 'FEDERATED' is disabled.
 hlrdb_1 | mysqld: Table 'mysql.plugin' doesn't exist
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: The InnoDB memory heap is disabled
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Memory barrier is not used
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Compressed tables use zlib 1.2.3
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Using Linux native AIO
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Not using CPU crc32 instructions
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
 hlrdb_1 | 2014-10-31 16:59:24 1 [Note] InnoDB: Completed initialization of buffer pool
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 0 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] Plugin 'InnoDB' init function returned error.
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] Unknown/unsupported storage engine: InnoDB
 hlrdb_1 | 2014-10-31 16:59:24 1 [ERROR] Aborting

"Could not create system tablespace" seems to be the critical message. The instance was started using "fig" from this fig.yml:

 hlrdb:
   image: mysql:5.6.21

   ports:
 - "3306:3306"

   environment:
 - MYSQL_ROOT_PASSWORD=XXXX
 - MYSQL_USER=XXXX
 - MYSQL_PASSWORD=XXXX
 - MYSQL_DATABASE=XXXX

(XXXes has been included to protect the innocent ;-)

  • What's going on?
  • How could this problem suddenly appear?
  • How to fix it?

All help is highly appreciated.

Does not support `load data infile`?

mysql> load data infile '/var/www/html/proj/fixture/20141230.csv' REPLACE INTO TABLE customer;
ERROR 13 (HY000): Can't get stat of '/var/www/html/proj/fixture/20141230.csv' (Errcode: 2)
mysql> load data local infile '/var/www/html/proj/fixture/20141230.csv' REPLACE INTO TABLE customer;
ERROR 1148 (42000): The used command is not allowed with this MySQL version

Option to turn off name resolution

Hi,

I would like to submit this feature request to add an option of disabling name resolution. (skip_name_resolve ON/OFF)

This would be great. Thanks!

//Marcus

Connection timeout with nodejs app occasionally

I am using docker-compose to connect a nodejs app to a mysql database with the following .yml file:

db:
  image: mysql
  ports:
    - "3306:3306"
  environment:
    - MYSQL_ROOT_PASSWORD=password
    - MYSQL_DATABASE=sane
server:
  image: artificial/docker-sails:iojs-full-stable-pm2
  command: sails lift --verbose
  volumes:
    - server/:/server
  ports:
    - "1337:1337"
  links:
    - db

Often it works, but often I get a timeout and a warning '2015-03-04 14:40:37 1 [Warning] IP address '172.17.0.15' could not be resolved: Temporary failure in name resolution' I am not entirely sure if the issue is here, or in the app itself, since if I switch to the postgresql I have no issues as well.

Still trying to nail down where exactly the issue arises, this is more to keep track of it in case it is an issue with the image being slow or something.

specify workdir or fix my_print_defaults?

I built Docker image derived from the official mysql image, and was not able to run the entrypoint.sh if I changed the WORKDIR. Rather, I would get an error of the form:

FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

Either the docs should be amended to point out this restriction, or the mysql install needs to be polished, or perhaps the entrypoint.sh script should cd /usr/local/mysql before calling mysqld.

Document suggested workaround for no connections until DB init complete

When using docker-compose, even if one service is marked as depending on the mysql service, the first service is started before the initial DB init is complete - and it is then unable to initially connect to the mysql service, causing errors:
https://github.com/docker-library/docs/tree/master/mysql#no-connections-until-mysql-init-completes

It would be good to add to the documentation at that link with a couple of suggested workarounds, eg using mysqladmin ping (example) or nc (for when mysqladmin is not available; slightly over-complex example) - to save everyone from having to reinvent the wheel :-)

Host independent data-only container for MySQL

Continuing from #65

@md5

If /var/lib/mysql directory is used with data-only container, that would be host-specific solution as well. Is there a way to make it host independent?

Would docker export and docker load save the data dump as well?

Export tar size is slightly bigger after creating a simple table in MySQL database. But that still requires the directory to be created on the different host. What is the host independent solution?

MySQL data is not stored in data-only container

Creating a data-only container as docker create -v /var/lib/mysql --name mysql_data mysql:latest

Running a MySQL container as:

docker run --name mysqldb --volumes-from mysql_data -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -it -p 3306:3306 mysql

The data is not stored in the data-only container. This is verified by looking at the empty /var/lib/mysql directory on Boot2Docker host. This is also confirmed by logging into MySQL container and looking at /var/lib/mysql, which shows:

root@d69cb6430d9e:/var/lib/mysql# ls
auto.cnf  ib_logfile0  ib_logfile1  ibdata1  mysql  performance_schema  sample

I was expecting this to show up on the volume mounted by data-only container.

Cannot connect to mysql database: Access denied

I have issues connecting to the mysql database spawned by this docker container. I ger repeated access denied errors. I tried multiple ways:

  • use nsenter to enter the mysql container and then the mysql client to connect as root or as user (as configured with the environment variables): nsenter --target $(docker inspect --format {{.State.Pid}} etc_mysql_1) --mount --uts --ipc --net --pid /bin/bash
  • use a linked container as the documentation shows: run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
  • in my application container, run the mysql client and connect from there

I tried with and without a password. With the root user and with $MYSQL_USER. With the -h localhost or -h mysql or without. Each time, I get an error similar to this:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

This is the environment of the mysqld process:

root@07632642725f:/# tr '\0' '\n' </proc/1/environ 
HOSTNAME=07632642725f
MYSQL_VERSION=5.6.23
MYSQL_DATABASE=webmail
MYSQL_PASSWORD=webmailpasswd
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
SHLVL=0
HOME=/root
MYSQL_MAJOR=5.6
MYSQL_USER=webmail
MYSQL_ROOT_PASSWORD=rootpasswd

Do you have an idea why it fails?

Thank you

Database Does Not Exists

I run mysql container in which I create a database named TEST:

docker run --name jw-mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=root -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=TEST -d mysql

Then I start the tomcat container (also official) linking the the mysql container

docker run --name SimpleJSP --link jw-mysql:mysql -d -p 8888:8080 tomcat:8.0

I get the following error when attempting to connect via mysql JDBC drive:
Unable to get connection, DataSource invalid: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'TEST'

My connection url is:
url="jdbc:mysql://mysql/TEST"

It appears that the database does not exists. Please advise on how I can tell if the database was created using MYSQL_DATABASE=TEST

Thank you in advance

Connect from host?

I created my container with:

$ docker run —­name db -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql:latest

On my OS X, I used boot2docker ip to get the IP and I got 192.168.59.103. Then I tried to connect from host:

$ mysql -u root -h 192.168.59.103

But I'm getting:

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.59.103' (61)

What I'm doing wrong?

container does not start when ports beeing forwarded

docker run -e MYSQL_ROOT_PASSWORD=password -p 33066:3306 mysql

Error response from daemon: Cannot start container d21750c5bd3a5c1f873a4be97c49f2897fbcc20c9c4344075bd2e2e2d32e8b50: (exit status 1)

docker-compose also is not able to start the container

cat docker-compose.yml
db:
image: mysql
ports:

  • "33066:3306"
    environment:
  • MYSQL_PASSWORD=password

is this behavior intended?

License?

In 7c7b508, we added GPL-2+ with the comment of "Upstream's license is complicated, but this gets us decent compatibility."

I don't think this is anywhere near a closed debate, and I'd really love to get some upstream suggestion on where we should go with this (even if just to remove the + and be strict GPL-2). ❤️

cc @ltangvald

How to Populate database at container creation

I have the container running, all the MYSQL_ parameters worked, the database was created and the user was defined and granted access to the database.. running in daemon mode

the database is empty as expected
I want to execute the sql file that contains all the DB schema commands (create table, ....)

I can create a script and run docker exec mysql,
IF I did -v to map some host volume into the container when I started it

is this the proper way?

in my script, how do I wait til the daemon container is up and running?
try docker exec repeatedly til it works? (shouldn't work til the container CMD is running)

I have also created my own image which does all the same things this does and adds support for database population, but it makes no sense to manage my own image.

Copying jenkins.mysql.cnf to conf.d directory does not load configuration even though it ends in .cnf

Copying a file called jenkins.mysql.cnf to the conf.d directory does not load the configuration even though it ends in .cnf. According to the documentation - "The MySQL startup configuration is specified in the file /etc/mysql/my.cnf, and that file in turn includes any files found in the /etc/mysql/conf.d directory that end with .cnf"

This is my file content -

[mysqld]
local-infile=1
group_concat_max_len=16777215

This seems like an odd bug. Perhaps because I have two periods?

Travis runs failing in mysql-basics with "mysqld failed to accept connetions in a reasonable amount of time!"

eg:
https://travis-ci.org/docker-library/mysql/jobs/66373324

Successfully built 6a18d5aa6546

The command "docker build -t "$image" ." exited with 0.

24.05s$ ~/official-images/test/run.sh "$image"
testing mysql:5.6
    'utc' [1/4]...passed
    'cve-2014--shellshock' [2/4]...passed
    'no-root-password' [3/4]...passed
    'mysql-basics' [4/4]...mysqld failed to accept connetions in a reasonable amount of time!
time="2015-06-11T12:33:59Z" level=fatal msg="Error response from daemon: Cannot start container 941844c4923e471eb7cfc25015bffbd6ef6064200f6ce6f631b9a41ac6bbfed8: Cannot link to a non running container: /mysql-container-22962-26882 AS /furious_albattani/mysql" 
failed

The command "~/official-images/test/run.sh "$image"" exited with 1.

Additionally, the mysql:5.7 runs are not even building, will file a separate issue for that.

gpg keyserver timed out

I think there might be a problem with the new keyserver. In Dockerfile Step 3

Step 3 : RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
 ---> Running in 2c694a391b75
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.t4dFVjxGv1 --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
gpg: requesting key 5072E1F5 from hkp server pool.sks-keyservers.net
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
INFO[0120] The command [/bin/sh -c apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5] returned a non-zero code: 2 

When I changed it to

RUN apt-key adv --keyserver pool.sks-keyservers.net:80 --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5

based on this link it gives

Step 3 : RUN apt-key adv --keyserver pool.sks-keyservers.net:80 --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
 ---> Running in 71918756993d
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.BpCv0sNqRg --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg --keyserver pool.sks-keyservers.net:80 --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
gpg: requesting key 5072E1F5 from pool.sks-keyservers.net:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver receive failed: keyserver error
INFO[0000] The command [/bin/sh -c apt-key adv --keyserver pool.sks-keyservers.net:80 --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5] returned a non-zero code: 2

Thanks in advance.

IP address '172.17.0.21' could not be resolved: Name or service not known

I linked mysqlserver to tomcat docker and im getting this issue

Finished mysql_install_db
150407 5:23:38 [Note] Plugin 'FEDERATED' is disabled.
150407 5:23:38 InnoDB: The InnoDB memory heap is disabled
150407 5:23:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150407 5:23:38 InnoDB: Compressed tables use zlib 1.2.3
150407 5:23:38 InnoDB: Using Linux native AIO
150407 5:23:38 InnoDB: Initializing buffer pool, size = 128.0M
150407 5:23:38 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150407 5:23:38 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150407 5:23:38 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
150407 5:23:38 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150407 5:23:39 InnoDB: Waiting for the background threads to start
150407 5:23:40 InnoDB: 5.5.42 started; log sequence number 0
150407 5:23:40 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150407 5:23:40 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150407 5:23:40 [Note] Server socket created on IP: '0.0.0.0'.
150407 5:23:40 [Note] Event Scheduler: Loaded 0 events
150407 5:23:40 [Note] mysqld: ready for connections.
Version: '5.5.42' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
150407 5:25:08 [Warning] IP address '172.17.0.21' could not be resolved: Name or service not known

Note: ip address of this container is 172.17.0.19 and i dont understand why it is trying to resolve 172.16.0.21. even tomcat container ip address is 172.17.0.20

signalling for indicating init process is finished

when doing a scripted deploy, and the mysql image is deployed for the first time, it would be useful that a script can wait for the init process (eg creation of database) to be finished (without having to sleep for some time). Eg a touched file in /var/lib/mysql that is only available when the init process has run.

MySQL 5.6.22 image is broken

There seems to bee an issue with the MySQL 5.6.22 image on the registry.

This came to light while discussing another issue; #44 (comment)

To reproduce:

docker run -d -h mysql --name mysqltmount_all_dir -v $PWD/mysql/var/lib/mysql:/var/lib/mysql -v $PWD/mysql/etc/mysql:/etc/mysql -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=mmx -e MYSQL_PASSWORD=mmx -e MYSQL_DATABASE=mmx mysql:5.6.22

And check the logs;

docker logs mysqltmount_all_dir

....

2015-01-28 21:08:53 1 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2015-01-28 21:08:53 1 [ERROR] Aborting

2015-01-28 21:08:53 1 [Note] Binlog end
2015-01-28 21:08:53 1 [Note] mysqld: Shutdown complete

I've pasted the full logs here:
https://gist.github.com/thaJeztah/62dc9d655e8e836414f7

Unable to log in from localhost.

It appears as though after following the instructions to start the container, I'm unable to log in via localhost and whatever root password I've set. I haven't done anything special, so the instructions you see on the docker homepage are exactly what I've done.

Is there anything special I have to do to simply be able to connect with workbench? Running on OSX Yosemite via boot2docker.

Still getting familiar with things, so if there's something it might help to know, just ask.

Data garbage collection issue when containers deleted using boot2docker?

I'm not sure if this is an issue for this container, but if a container switch (--boot2dockersafe ?!) can be used to mollify its effect, it might be helpful?!

I've been running several MySQL containers using the recipe described in this tutorial on how to use mysql with docker and after a while I became unable to run any new containers because of a memory issue when running in boot2docker:

bash-3.2$ docker logs mot2013db
Running mysql_install_db ...
2015-01-13 11:22:01 12 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-13 11:22:01 12 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-13 11:22:01 12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-13 11:22:01 12 [Note] InnoDB: Memory barrier is not used
2015-01-13 11:22:01 12 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-13 11:22:01 12 [Note] InnoDB: Using Linux native AIO
2015-01-13 11:22:01 12 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-13 11:22:01 12 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-13 11:22:01 12 [Note] InnoDB: Completed initialization of buffer pool
2015-01-13 11:22:01 12 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-01-13 11:22:01 12 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-01-13 11:22:01 12 [Note] InnoDB: Database physically writes the file full: wait...
2015-01-13 11:22:01 7fe33467a720 InnoDB: Error: Write to file ./ibdata1 failed at offset 0.
InnoDB: 1048576 bytes should have been written, only -1 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means 'No space left on device'.
...
bash-3.2$boot2docker ssh
docker@boot2docker:~$ sudo su
root@boot2docker:/home/docker# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 1851004     87896   1763108   5% /
tmpfs                  1851004     87896   1763108   5% /
tmpfs                  1028332         0   1028332   0% /dev/shm
/dev/sda1             19049892  17272684    786484  96% /mnt/sda1
cgroup                 1028332         0   1028332   0% /sys/fs/cgroup
none                 975922976 225944640 749978336  23% /Users
/dev/sda1             19049892  17272684    786484  96% /mnt/sda1/var/lib/docker/aufs

In the A garbage collection bug in Docker section of The Rabbit Hole of Using Docker in Automated Tests the author comments (my emphasis):

All of a sudden I get an error from Docker that it is out of space. ... At this point, I'm using boot2docker to host Docker. ... I SSH into it, run df, and sure enough, the VM is nearly out of space. But I looked at docker images -a and confirmed there's not enough data to fill the disk. ... When running Docker on aufs filesystems (like boot2docker does), Docker does not always remove data volumes containers when deleting a container. It turns out that the MySQL containers from the official Docker library were creating a data-only container to hold persistent MySQL data that outlives the container itself. These containers are apparently light magic. They are containers that are attached to other containers, but they don't really show up in the Docker interfaces. When you delete the host container, these containers are supposed to be garbage collected. Except on aufs, they aren't. My MySQL containers were creating 1+ GB InnoDB data files on start and the associated data containers were sitting around after container deletion, effectively leaking 1+ GB every time I created a MySQL container, quickly filling the boot2docker disk. Derp.

I worked around this problem by forking the official MySQL container. I didn't need persistent MySQL data (the containers only need to live for one invocation - for the lifetime of a single test), so I couldn't care less about persisted data volumes. So, I changed the MySQL container to hold its data locally, not in a data volume container. The solution was simple enough. But it took me a while to identify the problem. Here I was seeing Docker do something extremely stupid. Surely my understanding of Docker was wrong and I was doing something stupid to cause it to leak data. I spent hours digging through the documentation to make sure I was doing things exactly as recommended. It wasn't until I started an Ubuntu VM and tried the same thing there did I realize this looked like a bug in boot2docker. A few Google searches later led me to a comment hiding at the bottom of an existing GitHub issue that pins aufs as the culprit. And here I thought Docker reached 1.0 and wouldn't have bad bugs like this. I certainly wouldn't expect boot2docker to be shipping a VM with a sub-par storage driver (shouldn't it be using devicemapper or btrfs instead). Whatever.*

MySQL init process in progress... MySQL init process failed.

I have no idea how to debug this problem installing mysql:latest on CoreOS Alpha - 723.0.0, using either the simplest docker run command as supplied in the docs, or more realistic environment variables.

$ docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609-dirty
OS/Arch (client): linux/amd64
Server version: 1.7.0
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 0baf609-dirty
OS/Arch (server): linux/amd64

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
2f4e7656c7427f812ea0cc78c410e387a12636f6d476418a911517bcb72ba9bc

$ docker logs some-mysql
Running mysql_install_db
2015-06-26 03:19:46 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 28 ...
2015-06-26 03:19:46 28 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-26 03:19:46 28 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-26 03:19:46 28 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-06-26 03:19:46 28 [Note] InnoDB: Memory barrier is not used
2015-06-26 03:19:46 28 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-06-26 03:19:46 28 [Note] InnoDB: Using Linux native AIO
2015-06-26 03:19:46 28 [Note] InnoDB: Using CPU crc32 instructions
2015-06-26 03:19:46 28 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-06-26 03:19:46 28 [Note] InnoDB: Completed initialization of buffer pool
2015-06-26 03:19:46 28 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-06-26 03:19:46 28 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-06-26 03:19:46 28 [Note] InnoDB: Database physically writes the file full: wait...
2015-06-26 03:19:46 28 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-06-26 03:19:46 28 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-06-26 03:19:46 28 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-06-26 03:19:46 28 [Warning] InnoDB: New log files created, LSN=45781
2015-06-26 03:19:46 28 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-06-26 03:19:46 28 [Note] InnoDB: Doublewrite buffer created
2015-06-26 03:19:46 28 [Note] InnoDB: 128 rollback segment(s) are active.
2015-06-26 03:19:46 28 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-06-26 03:19:46 28 [Note] InnoDB: Foreign key constraint system tables created
2015-06-26 03:19:46 28 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-06-26 03:19:46 28 [Note] InnoDB: Tablespace and datafile system tables created.
2015-06-26 03:19:46 28 [Note] InnoDB: Waiting for purge to start
2015-06-26 03:19:46 28 [Note] InnoDB: 5.6.25 started; log sequence number 0
2015-06-26 03:19:47 28 [Note] Binlog end
2015-06-26 03:19:47 28 [Note] InnoDB: FTS optimize thread exiting.
2015-06-26 03:19:47 28 [Note] InnoDB: Starting shutdown...
2015-06-26 03:19:48 28 [Note] InnoDB: Shutdown completed; log sequence number 1625977


2015-06-26 03:19:48 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 51 ...
2015-06-26 03:19:48 51 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-26 03:19:48 51 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-26 03:19:48 51 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-06-26 03:19:48 51 [Note] InnoDB: Memory barrier is not used
2015-06-26 03:19:48 51 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-06-26 03:19:48 51 [Note] InnoDB: Using Linux native AIO
2015-06-26 03:19:48 51 [Note] InnoDB: Using CPU crc32 instructions
2015-06-26 03:19:48 51 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-06-26 03:19:48 51 [Note] InnoDB: Completed initialization of buffer pool
2015-06-26 03:19:48 51 [Note] InnoDB: Highest supported file format is Barracuda.
2015-06-26 03:19:48 51 [Note] InnoDB: 128 rollback segment(s) are active.
2015-06-26 03:19:48 51 [Note] InnoDB: Waiting for purge to start
2015-06-26 03:19:48 51 [Note] InnoDB: 5.6.25 started; log sequence number 1625977
2015-06-26 03:19:49 51 [Note] Binlog end
2015-06-26 03:19:49 51 [Note] InnoDB: FTS optimize thread exiting.
2015-06-26 03:19:49 51 [Note] InnoDB: Starting shutdown...
2015-06-26 03:19:50 51 [Note] InnoDB: Shutdown completed; log sequence number 1625987




PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h 2f4e7656c742 password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Note: new default config file not created.
Please make sure your config file is current

WARNING: Default config file /etc/mysql/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

Finished mysql_install_db
MySQL init process in progress...
MySQL init process in progress...
/entrypoint.sh: line 39:    74 Killed                  mysqld --user=mysql --datadir="$DATADIR" --skip-networking
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process failed.

MySQL 5.5 build is missing 'mysql_install_db'

Starting 5.5 container:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql:5.5

does not work due to missing mysql_install_db script.

$ docker ps -a
CONTAINER ID        IMAGE                                          COMMAND                CREATED              STATUS                            PORTS                    NAMES
84193fdd5803        mysql:5.5                                      "/entrypoint.sh mysq   12 seconds ago       Exited (127) 11 seconds ago                                focused_galileo  

$ docker logs 84193fdd5803
Running mysql_install_db ...
/entrypoint.sh: line 19: mysql_install_db: command not found

Connection lost on import of database

This keeps happening about 30 minutes into import. There are no interesting messages in the logs. Not sure what is going on here.

ERROR 2013 (HY000): Lost connection to MySQL server during query
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    6
Current database: dev_imobitrax

Unable to perform docker exec

I am unable to issue a "docker exec" command against the MySQL container. It looks like the container can't find the WORKINGDIR from the Dockerfile.

docker-exec: failed to exec: chdir to /usr/local/mysql no such file or directory

Travis mysql:5.7 runs timing out during build, after "debconf: falling back to frontend: Teletype"

eg:
https://travis-ci.org/docker-library/mysql/jobs/66373323

...
Setting up mysql-community-server (5.7.7-rc-1debian7) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype

No output has been received in the last ... minutes, this potentially indicates a stalled build or something wrong with the build itself.

The build has been terminated

MySQL Immediately Shuts Down Due To Storage Engine Problem

I've having difficulty starting a docker image for this dockerfile. Everything I do seems to produce a similar result: mysql starts, has trouble with the innodb engine, and immediately shutsdown. Here's the steps to reproduce:

uname --all
Linux magento2 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

docker --version
Docker version 1.4.1, build 5bc2ff8

docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
e6876c7a3e12729b1201334acd0f590245a21f5a4ca0582645059c0c3006c9a9

docker logs mysql

Running mysql_install_db ...
2015-01-08 04:03:04 12 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-08 04:03:04 12 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-08 04:03:04 12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-08 04:03:04 12 [Note] InnoDB: Memory barrier is not used
2015-01-08 04:03:04 12 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-08 04:03:04 12 [Note] InnoDB: Using Linux native AIO
2015-01-08 04:03:04 12 [Note] InnoDB: Using CPU crc32 instructions
2015-01-08 04:03:04 12 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-08 04:03:04 12 [Note] InnoDB: Completed initialization of buffer pool
2015-01-08 04:03:04 12 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-01-08 04:03:04 12 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-01-08 04:03:04 12 [Note] InnoDB: Database physically writes the file full: wait...
2015-01-08 04:03:04 12 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-01-08 04:03:04 12 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-01-08 04:03:04 12 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-01-08 04:03:04 12 [Warning] InnoDB: New log files created, LSN=45781
2015-01-08 04:03:04 12 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-01-08 04:03:04 12 [Note] InnoDB: Doublewrite buffer created
2015-01-08 04:03:04 12 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-08 04:03:04 12 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-01-08 04:03:04 12 [Note] InnoDB: Foreign key constraint system tables created
2015-01-08 04:03:04 12 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-01-08 04:03:04 12 [Note] InnoDB: Tablespace and datafile system tables created.
2015-01-08 04:03:04 12 [Note] InnoDB: Waiting for purge to start
2015-01-08 04:03:04 12 [Note] InnoDB: 5.6.22 started; log sequence number 0
2015-01-08 04:03:04 12 [Note] Binlog end
2015-01-08 04:03:04 12 [Note] InnoDB: FTS optimize thread exiting.
2015-01-08 04:03:04 12 [Note] InnoDB: Starting shutdown...
2015-01-08 04:03:06 12 [Note] InnoDB: Shutdown completed; log sequence number 1625977
Installing MySQL system tables...OK

2015-01-08 04:03:06 35 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-08 04:03:06 35 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-08 04:03:06 35 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-08 04:03:06 35 [Note] InnoDB: Memory barrier is not used
2015-01-08 04:03:06 35 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-08 04:03:06 35 [Note] InnoDB: Using Linux native AIO
2015-01-08 04:03:06 35 [Note] InnoDB: Using CPU crc32 instructions
2015-01-08 04:03:06 35 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-08 04:03:06 35 [Note] InnoDB: Completed initialization of buffer pool
2015-01-08 04:03:06 35 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-08 04:03:06 35 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-08 04:03:06 35 [Note] InnoDB: Waiting for purge to start
2015-01-08 04:03:06 35 [Note] InnoDB: 5.6.22 started; log sequence number 1625977
2015-01-08 04:03:06 35 [Note] Binlog end
2015-01-08 04:03:06 35 [Note] InnoDB: FTS optimize thread exiting.
2015-01-08 04:03:06 35 [Note] InnoDB: Starting shutdown...
2015-01-08 04:03:08 35 [Note] InnoDB: Shutdown completed; log sequence number 1625987
Filling help tables...OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h e6876c7a3e12 password 'new-password'

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /usr/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/mysql/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

Finished mysql_install_db
2015-01-08 04:03:09 1 [Note] Plugin 'FEDERATED' is disabled.
2015-01-08 04:03:09 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-08 04:03:09 1 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-08 04:03:09 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-08 04:03:09 1 [Note] InnoDB: Memory barrier is not used
2015-01-08 04:03:09 1 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-08 04:03:09 1 [Note] InnoDB: Using Linux native AIO
2015-01-08 04:03:09 1 [Note] InnoDB: Using CPU crc32 instructions
2015-01-08 04:03:09 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2015-01-08 04:03:09 1 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' init function returned error.
2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-01-08 04:03:09 1 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-01-08 04:03:09 1 [ERROR] Aborting

2015-01-08 04:03:09 1 [Note] Binlog end
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'partition'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'BLACKHOLE'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'ARCHIVE'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_METRICS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_TRX'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MEMORY'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'CSV'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MRG_MYISAM'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MyISAM'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'sha256_password'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'mysql_old_password'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'mysql_native_password'
2015-01-08 04:03:09 1 [Note] Shutting down plugin 'binlog'
2015-01-08 04:03:09 1 [Note] mysqld: Shutdown complete

UTC-8 support

The default encoding for databse is not UTF-8.
I have created new Docker image with /etc/my.cnf :

[mysqld]
character-set-server = utf8
collation-server = utf8_unicode_ci
skip-character-set-client-handshake

and it works for Chinses. I think more than half of the world's population need utf-8 support!

MySQL docker 5.7.6 and later fails to initialize database

When using the docker image to start without an existing database, the container's entrypoint.sh script tries to call the mysqld binary to create the database. This fails in versions later than 5.7.5 because the script starts by calling mysqld --verbose --help to get the configured datadir and when that runs and there is no database, it initializes it automatically.

When the script then calls --initialize, that fails with the error:

 [ERROR] --initialize specified but the data directory has files in it. Aborting.

The workaround is to run mysql:5.7.5 to create the database, then upgrade to a later image, which will work because the database already exists.

"/entrypoint.sh: line 9: [: /var/run/mysqld/mysqld.sock: binary operator expected"

docker-compose.yml:

web:
  build: .
  ports:
    - "80:80"
  links:
    - db
db:
  build: docker/db

docker/db/Dockerfile:

FROM mysql:5.6
MAINTAINER Mozilla

ENV MYSQL_ROOT_PASSWORD=root \
    MYSQL_DATABASE=bugs \
    MYSQL_USER=bugzilla \
    MYSQL_PASSWORD=bugs

EXPOSE 3606

VOLUME /var/lib/mysql

COPY my.cnf /etc/mysql/conf.d/
RUN chmod 644 /etc/mysql/conf.d/my.cnf

docker-compose up:

Recreating bmo_db_1...
Creating bmo_db_1...
Recreating bmo_web_1...
Creating bmo_web_1...
Attaching to bmo_db_1, bmo_web_1
db_1  | /entrypoint.sh: line 9: [: /var/run/mysqld/mysqld.sock: binary operator expected
db_1  | 2015-06-07 00:01:47 0 [Note] mysqld (mysqld 5.6.25) starting as process 1 ...

Am I doing something wrong, or is the "binary operator expected" warning/error a bug?

docker@boot2docker:/c/Users/Ed/src/bmo$ docker --version
Docker version 1.6.2, build 7c8fca2
docker@boot2docker:/c/Users/Ed/src/bmo$ docker-compose --version
docker-compose 1.3.0rc1

Thanks! :-)

README should list the environment variables

Images should be usable without reading the Dockerfile.

Hence, the README should give descriptions to the available environment variables:

  • MYSQL_ROOT_PASSWORD: Set the "root" user password when the container is run for the first time. Required.
  • MYSQL_USER, MYSQL_PASSWORD: Optionally, specify the user/password to create
  • MYSQL_DATABASE: Optionally, specify the name of a database to create. If a user/password was specified, the account will be granted (GRANT ALL) with the access to this database.

mysql immediately stops after running

I run this command:

docker run -e MYSQL_ROOT_PASSWORD=root --rm -i -t mysql

And I get this output:

Installing MySQL system tables...2014-07-25 16:13:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-25 16:13:10 15 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-25 16:13:10 15 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-25 16:13:10 15 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-25 16:13:10 15 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-25 16:13:10 15 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-25 16:13:10 15 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-25 16:13:10 15 [Note] InnoDB: Completed initialization of buffer pool
2014-07-25 16:13:10 15 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-07-25 16:13:10 15 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-07-25 16:13:10 15 [Note] InnoDB: Database physically writes the file full: wait...
2014-07-25 16:13:10 15 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-07-25 16:13:11 15 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-07-25 16:13:11 15 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-07-25 16:13:11 15 [Warning] InnoDB: New log files created, LSN=45781
2014-07-25 16:13:11 15 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-07-25 16:13:11 15 [Note] InnoDB: Doublewrite buffer created
2014-07-25 16:13:11 15 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-25 16:13:11 15 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-07-25 16:13:11 15 [Note] InnoDB: Foreign key constraint system tables created
2014-07-25 16:13:11 15 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-07-25 16:13:11 15 [Note] InnoDB: Tablespace and datafile system tables created.
2014-07-25 16:13:11 15 [Note] InnoDB: Waiting for purge to start
2014-07-25 16:13:11 15 [Note] InnoDB: 5.6.17 started; log sequence number 0
2014-07-25 16:13:11 15 [Note] Binlog end
2014-07-25 16:13:11 15 [Note] InnoDB: FTS optimize thread exiting.
2014-07-25 16:13:11 15 [Note] InnoDB: Starting shutdown...
2014-07-25 16:13:13 15 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2014-07-25 16:13:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-25 16:13:13 39 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-25 16:13:13 39 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-25 16:13:13 39 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-25 16:13:13 39 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-25 16:13:13 39 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-25 16:13:13 39 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-25 16:13:13 39 [Note] InnoDB: Completed initialization of buffer pool
2014-07-25 16:13:13 39 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-25 16:13:13 39 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-25 16:13:13 39 [Note] InnoDB: Waiting for purge to start
2014-07-25 16:13:13 39 [Note] InnoDB: 5.6.17 started; log sequence number 1625977
2014-07-25 16:13:13 39 [Note] Binlog end
2014-07-25 16:13:13 39 [Note] InnoDB: FTS optimize thread exiting.
2014-07-25 16:13:13 39 [Note] InnoDB: Starting shutdown...
2014-07-25 16:13:14 39 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h 3a7b83432209 password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

And then the docker run is finished. Any thoughts? I'v tried running with bash interactively and running with different commands (mysqld_safe, mysql.server) and nothing seems to work. What am I missing here?

Mysql Dockerfile is not secure

The use of ENV to pass the MYSQL_ROOT_PASSWORD is not a secure practice. Processes from the host can easily retrieve the password using ps, or inspecting /proc/PID/environ.

Also, the docker-entrypoint.sh script leaves a copy of the password in cleartext in /tmp/mysql-first-time.sql. I suppose you could argue that this is harmless, since direct access to the container would allow anyone to list the password by inspecting the environment, ie:

docker exec -ti some-mysql env

I was wondering if anyone else had noticed this, and what approach others may have taken to address these issues.

One thought that occured to me is to create a Dockerfile that inherits FROM mysql, and replace docker-entrypoint.sh with a version that embeds the password during the build process -- and removes this embedded password after the database has been initialized.

I'd be happy to tackle this and even submit a proposed fix or even a new image -- but I wanted to see if my lack of experience with docker was the issue -- and that there were better ideas out there.

Also, is there a more appropriate forum for security discussions related to docker? StackOverflow? Google? IRC? I wasn't sure.

Not able to shutdown the container

Starting container as:

docker run -i -t --name mysqldb -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret mysql

The container starts but not able to shut it down by pressing Ctrl+C.

-p option not working?

I am trying to run MySQL in a docker container and access it from the host machine. There are instructions on how to access MySQL through linked containers, but I couldn't find anything on connecting straight from the host. This seems easy, but I keep failing... Here's what I'm doing:

docker run --name demo-mysql -e MYSQL_ROOT_PASSWORD="eggs" -e MYSQL_USER=bacon -e MYSQL_PASSWORD='spam' -d mysql

docker ps lists 3306/tcp under PORTS, but mysql -u bacon -p yields the following error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2). I found that the the documentation states:

Note that EXPOSE only works for inter-container links. It doesn't make ports accessible from the host. To expose ports to the host, at runtime, use the -p flag.

However, when I try the following:

docker run --name techcyte-mysql -e MYSQL_ROOT_PASSWORD="eggs" -e MYSQL_USER=bacon -e MYSQL_PASSWORD='spam' -d -p 3306:3306 mysql

I get:

Error response from daemon: Cannot start container b267d2e1855db55f27f417366e5ea0666023807d9874040dc95c4e14115cff9b: (exit status 1)

As close as I can tell I am following the documentation correctly, but I am unable to connect to the mysql in the docker container from my host machine. What am I doing wrong?

Cannot persist the data by doing docker commit

Hi,

Please help! This is urgent to me.

I have tried to start the mysql image (5.6.22) in a couple of ways:

docker run -it -h mysql --name mysqlt1 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=mmx -e MYSQL_PASSWORD=mmx -e MYSQL_DATABASE=mmx mysql:5.6.22
docker run -it -h mysql --name mysqlt1 -v $PWD/var/lib/mysql:/var/lib/mysql -v $PWD/etc/mysql:/etc/mysql -e MYSQL_ROOT_PASSWORD=test mysql:5.6.22

Then, I commit the image, stop the old one, and start the new image by executing the same docker run command with the tag replaced with the new image's.

Result:

Every time when the new image starts, it will execute /tmp/mysql-first-time.sql and so the data is removed.

What I'd like to achieve is to persist the data inside the container. In the mounted volume is fine as well.

Startup Logs:

$ docker run -it -h mysql --name mysqlt2 -e MYSQL_ROOT_PASSWORD=test -e MYSQL_USER=mmx -e MYSQL_PASSWORD=mmx -e MYSQL_DATABASE=mmx mysql:t2
Running mysql_install_db ...
Installing MySQL system tables...2015-01-28 05:29:26 12 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-28 05:29:26 12 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-28 05:29:26 12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-28 05:29:26 12 [Note] InnoDB: Memory barrier is not used
2015-01-28 05:29:26 12 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-28 05:29:26 12 [Note] InnoDB: Using Linux native AIO
2015-01-28 05:29:26 12 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-28 05:29:26 12 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-28 05:29:26 12 [Note] InnoDB: Completed initialization of buffer pool
2015-01-28 05:29:26 12 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-01-28 05:29:26 12 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-01-28 05:29:26 12 [Note] InnoDB: Database physically writes the file full: wait...
2015-01-28 05:29:26 12 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-01-28 05:29:26 12 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-01-28 05:29:27 12 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-01-28 05:29:27 12 [Warning] InnoDB: New log files created, LSN=45781
2015-01-28 05:29:27 12 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-01-28 05:29:27 12 [Note] InnoDB: Doublewrite buffer created
2015-01-28 05:29:27 12 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-28 05:29:27 12 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-01-28 05:29:27 12 [Note] InnoDB: Foreign key constraint system tables created
2015-01-28 05:29:27 12 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-01-28 05:29:27 12 [Note] InnoDB: Tablespace and datafile system tables created.
2015-01-28 05:29:27 12 [Note] InnoDB: Waiting for purge to start
2015-01-28 05:29:27 12 [Note] InnoDB: 5.6.22 started; log sequence number 0
2015-01-28 05:29:27 12 [Note] Binlog end
2015-01-28 05:29:27 12 [Note] InnoDB: FTS optimize thread exiting.
2015-01-28 05:29:27 12 [Note] InnoDB: Starting shutdown...
2015-01-28 05:29:28 12 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2015-01-28 05:29:29 35 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-28 05:29:29 35 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-28 05:29:29 35 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-28 05:29:29 35 [Note] InnoDB: Memory barrier is not used
2015-01-28 05:29:29 35 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-28 05:29:29 35 [Note] InnoDB: Using Linux native AIO
2015-01-28 05:29:29 35 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-28 05:29:29 35 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-28 05:29:29 35 [Note] InnoDB: Completed initialization of buffer pool
2015-01-28 05:29:29 35 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-28 05:29:29 35 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-28 05:29:29 35 [Note] InnoDB: Waiting for purge to start
2015-01-28 05:29:29 35 [Note] InnoDB: 5.6.22 started; log sequence number 1625977
2015-01-28 05:29:29 35 [Note] Binlog end
2015-01-28 05:29:29 35 [Note] InnoDB: FTS optimize thread exiting.
2015-01-28 05:29:29 35 [Note] InnoDB: Starting shutdown...
2015-01-28 05:29:31 35 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h mysql password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /usr/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/mysql/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

Finished mysql_install_db
2015-01-28 05:29:32 1 [Note] Plugin 'FEDERATED' is disabled.
2015-01-28 05:29:32 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-28 05:29:32 1 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-28 05:29:32 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-28 05:29:32 1 [Note] InnoDB: Memory barrier is not used
2015-01-28 05:29:32 1 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-28 05:29:32 1 [Note] InnoDB: Using Linux native AIO
2015-01-28 05:29:32 1 [Note] InnoDB: Not using CPU crc32 instructions
2015-01-28 05:29:32 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-28 05:29:32 1 [Note] InnoDB: Completed initialization of buffer pool
2015-01-28 05:29:32 1 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-28 05:29:32 1 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-28 05:29:32 1 [Note] InnoDB: Waiting for purge to start
2015-01-28 05:29:32 1 [Note] InnoDB: 5.6.22 started; log sequence number 1625987
2015-01-28 05:29:32 1 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a3ae727e-a6ae-11e4-8719-0242ac110032.
2015-01-28 05:29:32 1 [Note] Server hostname (bind-address): '*'; port: 3306
2015-01-28 05:29:32 1 [Note] IPv6 is available.
2015-01-28 05:29:32 1 [Note]   - '::' resolves to '::';
2015-01-28 05:29:32 1 [Note] Server socket created on IP: '::'.
2015-01-28 05:29:32 1 [Note] Event Scheduler: Loaded 0 events
2015-01-28 05:29:32 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' started.
2015-01-28 05:29:32 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' ended.
2015-01-28 05:29:32 1 [Note] mysqld: ready for connections.
Version: '5.6.22'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
2015-01-28 05:36:47 1 [Note] mysqld: Normal shutdown

Env:

Os: OSX 10.10.1
Docker: Docker version 1.3.1, build 4e9bbfa
Boot2Docker-cli version: v1.3.1
Git commit: 57ccdb8

Thanks so much!

Provide mechanism to extend mysql image with additional SQL init scripts

Please provide mechanism to extend this image by providing additional SQL scripts to be executed upon initial server startup.

See official postgres image for example on how this can be done (“How to extend this image” section in readme).

You can arrange special directory for SQL files. All *.sql files found in that directory shall be appended to $TEMP_FILE that will be passed as --init-file parameter to MySQL.

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.