MariaDB Docker Start Fails

I’m trying to start MariaDB with Docker 1.13.1.

docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=password -p 3306:3306   -p 4567:4567/udp   -p 4567-4568:4567-4568   -p 4444:4444   -v /mnt/data/mysql:/var/lib/mysql mariadb:10.1 chown -R mysql:mysql /var/lib/mysql && mysqld --user=mysql --wsrep-new-cluster

I get the following output after starting:

  • Add multiple network interfaces inside a pod in Kubernetes
  • Big size of python image in Docker
  • Restrict Docker exposed port from only specific IP adresses
  • Install Ambari based on docker on multiple hosts
  • OpenShift Error creating: pods “pod-name” is forbidden: service account was not found
  • Nginx content caching causing Docker memory spike
  • 2017-05-11 20:04:55 139780804880320 [Note] mysqld (mysqld 10.1.23-MariaDB-1~jessie) starting as process 6 ...
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Using mutexes to ref count buffer pool pages
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: The InnoDB memory heap is disabled
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Compressed tables use zlib 1.2.8
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Using Linux native AIO
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Using SSE crc32 instructions
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Initializing buffer pool, size = 256.0M
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Completed initialization of buffer pool
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
    2017-05-11 20:04:55 139780804880320 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
    2017-05-11 20:04:56 139780804880320 [Warning] InnoDB: New log files created, LSN=45883
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Doublewrite buffer not found: creating new
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Doublewrite buffer created
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: 128 rollback segment(s) are active.
    2017-05-11 20:04:56 139780804880320 [Warning] InnoDB: Creating foreign key constraint system tables.
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Foreign key constraint system tables created
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Creating tablespace and datafile system tables.
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Tablespace and datafile system tables created.
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB: Waiting for purge to start
    2017-05-11 20:04:56 139780804880320 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 0
    2017-05-11 20:04:56 139780029413120 [Note] InnoDB: Dumping buffer pool(s) not yet started
    2017-05-11 20:04:56 139780804880320 [Note] Plugin 'FEEDBACK' is disabled.
    2017-05-11 20:04:56 139780804880320 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
    2017-05-11 20:04:56 139780804880320 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
    2017-05-11 20:04:56 139780804880320 [Note] Server socket created on IP: '::'.
    2017-05-11 20:04:56 139780804880320 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
    

    The mysql user owns the directory and is able to create the ibdata1 and related files. I can’t figure out if it’s failing to create other tables and/or why it’s failing to read them?

  • mongo addShard “No common protocol found” errmsg 126
  • Filebeat is not forwarding logs
  • Reusing docker environment variables in CLI
  • NGINX basic authentication based on environment variable
  • Accessing USB webcam hosted on OS X from a Docker container
  • make test failed when compile Node.js 4.0.0 source code in docker container
  • One Solution collect form web for “MariaDB Docker Start Fails”

    Fix:

    docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=password -p 3306:3306   -p 4567:4567/udp   -p 4567-4568:4567-4568   -p 4444:4444   -v /mnt/data/mysql:/var/lib/mysql mariadb:10.1 /bin/bash -c 'chown -R mysql:mysql /var/lib/mysql && mysqld --user=mysql --wsrep-new-cluster'
    

    The problem is that everything after the && is not inserted as command line inside the container but outside, in the host shell, unless properly quoted as an argument to the -c option of /bin/bash (/bin/sh is valid too).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.