GithubHelp home page GithubHelp logo

docker-mariadb's Introduction

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release featuring:

  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:

  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • Fleet - an online web interface which displays all of our maintained images.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build LSIO CI

Mariadb is one of the most popular database servers. Made by the original developers of MySQL.

mariadb

Supported Architectures

We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.

Simply pulling lscr.io/linuxserver/mariadb:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.

The architectures supported by this image are:

Architecture Available Tag
x86-64 amd64-<version tag>
arm64 arm64v8-<version tag>
armhf

Application Setup

If you didn't set a password during installation, (see logs for warning) use mariadb-admin -u root -p<PASSWORD> to set one at the docker prompt...

NOTE changing the MYSQL_ROOT_PASSWORD variable after the container has set up the initial databases has no effect, use the mysqladmin tool to change your MariaDB password.

NOTE if you want to use (MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD) all three of these variables need to be set you cannot pick and choose.

Unraid users, it is advisable to edit the template/webui after setup and remove reference to this variable.

Find custom.cnf in /config for config changes (restart container for them to take effect) , the databases in /config/databases and the log in /config/log/myqsl

Loading passwords and users from files

The MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD REMOTE_SQL env values can be set in a file:

/config/env

Using the following format:

MYSQL_ROOT_PASSWORD="ROOT_ACCESS_PASSWORD"
MYSQL_DATABASE="USER_DB_NAME"
MYSQL_USER="MYSQL_USER"
MYSQL_PASSWORD="DATABASE_PASSWORD"
REMOTE_SQL="http://URL1/your.sql,https://URL2/your.sql"

These settings can be mixed and matched with Docker ENV settings as you require, but the settings in the file will always take precedence.

Bootstrapping a new instance

We support a one time run of custom sql files on init. In order to use this place *.sql files in:

/config/initdb.d/

This will have the same effect as setting the REMOTE_SQL environment variable. The sql will only be run on the containers first boot and setup.

Check and Repair

If user databases are not in a healthy state (sometimes caused by a failed upgrade), it may be remedied by running:

mariadb-check -u root -p<PASSWORD> -c -A # check all databases for errors
mariadb-check -u root -p<PASSWORD> -r -A # repair all databases
mariadb-check -u root -p<PASSWORD> -a -A # analyze all databases
mariadb-check -u root -p<PASSWORD> -o -A # optimize all databases

After running the above commands, you may need to run the upgrade command again.

Upgrading

When this container initializes, if MYSQL_ROOT_PASSWORD is set an upgrade check will run. If an upgrade is required the log will indicate the need stop any services that are accessing databases in this container, and then run the command:

mariadb-upgrade -u root -p<PASSWORD>

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.

docker-compose (recommended, click here for more info)

---
services:
  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD
      - MYSQL_DATABASE=USER_DB_NAME #optional
      - MYSQL_USER=MYSQL_USER #optional
      - MYSQL_PASSWORD=DATABASE_PASSWORD #optional
      - REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql #optional
    volumes:
      - /path/to/mariadb/config:/config
    ports:
      - 3306:3306
    restart: unless-stopped
docker run -d \
  --name=mariadb \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD \
  -e MYSQL_DATABASE=USER_DB_NAME `#optional` \
  -e MYSQL_USER=MYSQL_USER `#optional` \
  -e MYSQL_PASSWORD=DATABASE_PASSWORD `#optional` \
  -e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql `#optional` \
  -p 3306:3306 \
  -v /path/to/mariadb/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/mariadb:latest

Parameters

Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 3306 MariaDB listens on this port.
-e PUID=1000 for UserID - see below for explanation
-e PGID=1000 for GroupID - see below for explanation
-e TZ=Etc/UTC specify a timezone to use, see this list.
-e MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD Set this to root password for installation (minimum 4 characters & non-alphanumeric passwords must be properly escaped).
-e MYSQL_DATABASE=USER_DB_NAME Specify the name of a database to be created on image startup.
-e MYSQL_USER=MYSQL_USER This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here).
-e MYSQL_PASSWORD=DATABASE_PASSWORD Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped).
-e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql Set this to ingest sql files from an http/https endpoint (comma seperated array).
-v /config Persistent config files

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Docker Mods

Docker Mods Docker Universal Mods

We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.

Support Info

  • Shell access whilst the container is running:

    docker exec -it mariadb /bin/bash
  • To monitor the logs of the container in realtime:

    docker logs -f mariadb
  • Container version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' mariadb
  • Image version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/mariadb:latest

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose

  • Update images:

    • All images:

      docker-compose pull
    • Single image:

      docker-compose pull mariadb
  • Update containers:

    • All containers:

      docker-compose up -d
    • Single container:

      docker-compose up -d mariadb
  • You can also remove the old dangling images:

    docker image prune

Via Docker Run

  • Update the image:

    docker pull lscr.io/linuxserver/mariadb:latest
  • Stop the running container:

    docker stop mariadb
  • Delete the container:

    docker rm mariadb
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)

  • You can also remove the old dangling images:

    docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver/docker-mariadb.git
cd docker-mariadb
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/mariadb:latest .

The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 31.05.24: - Rebase to Alpine 3.20.
  • 23.12.23: - Rebase to Alpine 3.19.
  • 09.06.23: - Update lc_messages path in shipped custom.cnf to match upstream.
  • 25.05.23: - Rebase to Alpine 3.18, deprecate armhf.
  • 04.02.23: - Minor updates to defaults in custom.cnf.
  • 31.01.23: - Rebase to 3.17.
  • 09.12.22: - Add upgrade check warning.
  • 11.10.22: - Rebase master to Alpine 3.16, migrate to s6v3, remove password escape logic which caused problems for a small subset of users.
  • 06.07.21: - Rebase master to alpine.
  • 03.07.21: - Rebase to 3.14.
  • 08.02.21: - Fix new installs.
  • 08.02.21: - Rebase to alpine. Add mariadb-backup.
  • 08.02.21: - Release alpine tag. The alpine release will replace the latest tag in the near future.
  • 27.10.19: - Bump to 10.4, ability use custom sql on initial init ,defining root passwords via file.
  • 23.03.19: - Switching to new Base images, shift to arm32v7 tag.
  • 07.03.19: - Add ability to setup a database and default user on first spinup.
  • 26.01.19: - Add pipeline logic and multi arch.
  • 10.09.18: - Rebase to ubuntu bionic and use 10.3 MariaDB repository.
  • 09.12.17: - Fix continuation lines.
  • 12.09.17: - Gracefully shut down MariaDB.
  • 27.10.16: - Implement linting suggestions on database init script.
  • 11.10.16: - Rebase to ubuntu xenial, add version labelling.
  • 09.03.16: - Update to MariaDB 10.1. Change to use custom.cnf over my.cnf in /config. Restructured init files to change config options on startup, rather than in the dockerfile.
  • 26.01.16: - Change user of mysqld_safe script to abc, better unclean shutdown handling on restart.
  • 23.12.15: - Remove autoupdating, between some version updates the container breaks.
  • 12.08.15: - Initial Release.

docker-mariadb's People

Contributors

aptalca avatar chbmb avatar drizuid avatar federico-razzoli avatar j0nnymoe avatar linuxserver-ci avatar lonix avatar nemchik avatar omgimalexis avatar phendryx avatar roxedus avatar sparklyballs avatar thelamer avatar thespad avatar yriveiro 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

docker-mariadb's Issues

[Warning] Aborted connection .... This connection closed normally without authentication

After a (mistakenly) update I get this error / warnings:

[Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: '172.17.0.1' (This connection closed normally without authentication)

I deleted the original image mistakenly or is it overwritten automaticaly, I use tag latest?

How can I reconnect to the db-instance?

I tried to install in a new database-folder, after new creating I copied the old files to this folder.
But after restart of the container I got the messages again.

I think I had version "Linuxserver.io version:- 110.4.11mariabionic-ls47 Build-date:- 2019-12-20T02:50:30+00:00" before update, but I can not found this on github or dockerhub.

update:

I than copied the IB-Log-Files to the directory, after restart of container the mariadb.err shows this repeatly:

210831 23:36:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
210831 23:36:15 mysqld_safe Starting mariadbd daemon with databases from /config/databases
2021-08-31 23:36:15 0 [Note] /usr/bin/mariadbd (mysqld 10.5.12-MariaDB-log) starting as process 10180 ...
2021-08-31 23:36:15 0 [Note] InnoDB: Uses event mutexes
2021-08-31 23:36:15 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-31 23:36:15 0 [Note] InnoDB: Number of pools: 1
2021-08-31 23:36:15 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-08-31 23:36:15 0 [Note] mariadbd: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2021-08-31 23:36:15 0 [Note] InnoDB: Using Linux native AIO
2021-08-31 23:36:15 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2021-08-31 23:36:15 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-31 23:36:15 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.18.
2021-08-31 23:36:15 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-31 23:36:15 0 [Note] InnoDB: Starting shutdown...
2021-08-31 23:36:15 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-31 23:36:15 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-31 23:36:15 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-31 23:36:15 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-08-31 23:36:15 0 [ERROR] Aborting

"-" in MYSQL_DATABASE breaks first install

The - character when used in the MYSQL_DATABASE compose variable breaks first install. Mariadb does not come properly up.

The same compose omitting just the problem - installs correctly.

Manually creating a database with the problem - name after first install works correctly.

Using the - in the MYSQL_DATABASE, MYSQL_USER, aliases or container name causes no issues.

I do not know if any other characters cause this issue.

No such file or directorynable to exec bash

linuxserver.io

I tried building locally and i followed this instruction

git clone https://github.com/linuxserver/docker-mariadb.git
cd docker-mariadb
docker build \
  --no-cache \
  --pull \
  -t ghcr.io/linuxserver/mariadb:latest .

but i get No such file or directorynable to exec bash

Environment

**OS: Dietpi
CPU architecture: arm32

Docker logs

root@DietPi:/home/dietpi/docker-mariadb# docker-compose up
Creating network "docker-mariadb_default" with the default driver
Creating mariadb ... done
Attaching to mariadb
mariadb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
mariadb    | [s6-init] ensuring user provided files have correct perms...exited 0.
mariadb    | [fix-attrs.d] applying ownership & permissions fixes...
mariadb    | [fix-attrs.d] done.
mariadb    | [cont-init.d] executing container initialization scripts...
mariadb    | [cont-init.d] 01-envfile: executing...
mariadb    | [cont-init.d] 01-envfile: exited 0.
mariadb    | [cont-init.d] 10-adduser: executing...
mariadb    |
mariadb    | -------------------------------------
mariadb    |           _         ()
mariadb    |          | |  ___   _    __
mariadb    |          | | / __| | |  /  \
mariadb    |          | | \__ \ | | | () |
mariadb    |          |_| |___/ |_|  \__/
mariadb    |
mariadb    |
mariadb    | Brought to you by linuxserver.io
mariadb    | -------------------------------------
mariadb    |
mariadb    | To support LSIO projects visit:
mariadb    | https://www.linuxserver.io/donate/
mariadb    | -------------------------------------
mariadb    | GID/UID
mariadb    | -------------------------------------
mariadb    |
mariadb    | User uid:    1000
mariadb    | User gid:    1000
mariadb    | -------------------------------------
mariadb    |
mariadb    | [cont-init.d] 10-adduser: exited 0.
mariadb    | [cont-init.d] 30-config: executing...
: No such file or directorynable to exec bash
mariadb    | [cont-init.d] 30-config: exited 127.
mariadb    | [cont-init.d] 40-initialise-db: executing...
: No such file or directorynable to exec bash
mariadb    | [cont-init.d] 40-initialise-db: exited 127.
mariadb    | [cont-init.d] 90-custom-folders: executing...
mariadb    | [cont-init.d] 90-custom-folders: exited 0.
mariadb    | [cont-init.d] 90-warning: executing...
: No such file or directorynable to exec bash
mariadb    | [cont-init.d] 90-warning: exited 127.
mariadb    | [cont-init.d] 99-custom-scripts: executing...
mariadb    | [custom-init] no custom files found exiting...
mariadb    | [cont-init.d] 99-custom-scripts: exited 0.
mariadb    | [cont-init.d] done.
mariadb    | [services.d] starting services
: No such file or directorynable to exec bash
mariadb    | [services.d] done.
: No such file or directorynable to exec bash
: No such file or directorynable to exec bash
: No such file or directorynable to exec bash
: No such file or directorynable to exec bash
: No such file or directorynable to exec bash
: No such file or directorynable to exec bash

Docker image ghcr.io/linuxserver/mariadb:110.4.15mariabionic-ls86 for linux/arm provide Ver 10.1.47-MariaDB-0ubuntu0.18.04.1

linuxserver.io

While trying docker image ghcr.io/linuxserver/mariadb:110.4.15mariabionic-ls86 on raspbian, I have found that mariadb server is not the correct one.


Expected Behavior

mariadb version should be "mysqld Ver 10.4.15-MariaDB-1:10.4.15+maria~bionic-log" as in amd64 docker image

Current Behavior

mariadb version is "mysqld Ver 10.1.47-MariaDB-0ubuntu0.18.04.1mysqld Ver 10.1.47-MariaDB-0ubuntu0.18.04.1"

Steps to Reproduce

  1. docker pull ghcr.io/linuxserver/mariadb:110.4.15mariabionic-ls86
  2. docker run --rm -t -i ghcr.io/linuxserver/mariadb:110.4.15mariabionic-ls86 mysqld --version

Environment

OS: raspbian
CPU architecture: x86_64/arm32/arm64
How docker service was installed:

From the official docker repo

Command used to create docker container (run/create/compose/screenshot)

Docker logs

Image information:

    "Id": "sha256:04708e886d7f27c62fcabb490cdf18e9a13f7e457b03957350311b3e0ddfb721",
    "RepoTags": [
        "linuxserver/mariadb:latest",
        "ghcr.io/linuxserver/mariadb:110.4.15mariabionic-ls86",
        "ghcr.io/linuxserver/mariadb:latest"
    ],
    "RepoDigests": [
        "linuxserver/mariadb@sha256:804dadb1be8cf274df045f5ca0df64001f6687dbb028275ee9a886eb50ff5f86",
        "ghcr.io/linuxserver/mariadb@sha256:804dadb1be8cf274df045f5ca0df64001f6687dbb028275ee9a886eb50ff5f86"
    ],

Extra information:

I have check if it was an issue with outdated package, and it seems that this issue is related to the following warning/error:

N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://mirror.rackspace.com/mariadb/repo/10.4/ubuntu bionic InRelease' doesn't support architecture 'armhf'N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://mirror.rackspace.com/mariadb/repo/10.4/ubuntu bionic InRelease' doesn't support architecture 'armhf'

Fails to start mariadb on pi

Just installed this on a pi and got errors

InnoDB: Cannot allocate memory for the buffer pool

Reducing it from 256 to 128 seems to have resolved it.

Support a sql dump for large files when initializing the container

linuxserver.io

Feature request

Currently, there is an option to initialize a database with a sql file when the container is initialized for the first time. However this method does not work for large sql files (mine is 1Mb for example).

Expected Behavior

I would expect that when the container starts for the first time, a command similar to mysql my_db < my_sql_dump.sql would be executed, even for large .sql files.

Current Behavior

Currently this dump does not work in my case. There is only 1 table structure (and no data) being imported in the container. I suspect that there is no problem with the .sqlfile as when execute the command in the container manually, it works. I execute the following command :
mysql -p my_db < /config/initdb.d/my_sql_dump.sql

Steps to Reproduce

  1. Copy a (potentially large) sql dump in database/initdb
  2. Start container mounting database in /config

Environment

OS: Raspbian
CPU architecture: arm
How docker service was installed:
Installation through docker compose

Command used to create docker container (run/create/compose/screenshot)

    db:
        image: linuxserver/mariadb:latest
        container_name: db
        ports:
            - 3308:3306
        volumes:
            - ./database:/config
        environment:
            - MYSQL_ROOT_PASSWORD=root
            - MYSQL_DATABASE=my_db
        restart: always

Permission denied while initializing database

Hi,

I installed linuxserver/mariadb via the addon manager on LibreElec (odroid c2). After configuring the root password, the docker container starts, but fails to initialize the database:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    65534
User gid:    65534
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing... 
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2019-07-22 23:06:43 0 [ERROR] mysqld: Can't create/write to file '/tmp/ibiFea8d' (Errcode: 13 "Permission denied")
2019-07-22 23:06:43 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2019-07-22 23:06:43 0 [ERROR] mysqld: Can't create/write to file '/tmp/ibikKa9h' (Errcode: 13 "Permission denied")
2019-07-22 23:06:43 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2019-07-22 23:06:43 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete th
2019-07-22 23:06:43 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-07-22 23:06:43 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-07-22 23:06:43 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-07-22 23:06:43 0 [ERROR] Aborting
Installation of system tables failed!  Examine the logs in
/config/databases for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
    shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
    shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;
Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /config/databases that may be helpful.
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss
Please check all of the above before submitting a bug report
at http://mariadb.org/jira
2019-07-22 23:06:43 0 [Note] mysqld (mysqld 10.3.16-MariaDB-1:10.3.16+maria~bionic-log) starting as process 269 ...
2019-07-22 23:06:43 0 [Note] InnoDB: Using Linux native AIO
2019-07-22 23:06:43 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will b
2019-07-22 23:06:43 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-07-22 23:06:43 0 [Note] InnoDB: Uses event mutexes
2019-07-22 23:06:43 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-07-22 23:06:43 0 [Note] InnoDB: Number of pools: 1
2019-07-22 23:06:43 0 [Note] InnoDB: Using generic crc32 instructions
2019-07-22 23:06:43 0 [ERROR] mysqld: Can't create/write to file '/tmp/ibmj1gur' (Errcode: 13 "Permission denied")
2019-07-22 23:06:43 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2019-07-22 23:06:43 0 [ERROR] mysqld: Can't create/write to file '/tmp/ibsH78II' (Errcode: 13 "Permission denied")
2019-07-22 23:06:43 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2019-07-22 23:06:43 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete th
2019-07-22 23:06:43 0 [Note] InnoDB: Starting shutdown...
2019-07-22 23:06:43 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-07-22 23:06:43 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-07-22 23:06:43 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-07-22 23:06:43 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2019-07-22 23:06:43 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-07-22 23:06:43 0 [ERROR] Aborting

Do you have any idea on what the problem could be?

[EDIT] [Feature Request] Write MySQLD console output to file (originally bug report)

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Normal start

Current Behavior

Infinite startup loop (similar to #42 but on x86_64)

Steps to Reproduce

  1. startup

Environment

OS: OpenMediaVault 5.5.8-1 (SMP Debian 5.7.10-1~bpo10+1 (2020-07-30) x86_64 GNU/Linux)
CPU architecture: x86_64
How docker service was installed: Single Click via OMV-Extras

Other information:

  • Happened after weekly restart after update between 11.08.2020 and 15.08.2020 (update log below)
  • Also happens on fresh installs and on system drive (there are a few problems with docker on Raid-Disks on OMV)
  • Docker itsels is located on Raid mount
  • Due to a current bug the container cannot do any DNS-Lookups unless the user ID is 1000

Command used to create docker container (run/create/compose/screenshot)

docker create \
  --name=mariadb \
  --net nextcloud-net \
  -e PUID=1007 \
  -e PGID=1001 \
  -e MYSQL_ROOT_PASSWORD=Azk3190 \
  -e TZ=Europe/Berlin \
  -p 3306:3306 \
  -v *appdatapath*/mariaDB:/config \
  --restart unless-stopped \
  linuxserver/mariadb

Docker logs

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1007
User gid:    1001
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing... 
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
200826 13:14:51 mysqld_safe Logging to syslog.
200826 13:14:51 mysqld_safe Starting mysqld daemon with databases from /config/databases
200826 13:14:54 mysqld_safe Logging to syslog.
200826 13:14:54 mysqld_safe Starting mysqld daemon with databases from /config/databases

Last 2 Lines looping infinetely

Update Logs

Start-Date: 2020-08-14  09:09:00
Commandline: apt-get --yes --allow-downgrades --allow-change-held-packages --fix-broken --fix-missing --auto-remove --allow-unauthenticated --show-upgraded --option DPkg::Options::=--force-confold install linux-image-5.7.0-0.bpo.2-amd64 linux-image-amd64 openmediavault salt-common salt-minion
Install: linux-image-5.7.0-0.bpo.2-amd64:amd64 (5.7.10-1~bpo10+1)
Upgrade: salt-minion:amd64 (3001+ds-1, 3001.1+ds-1), salt-common:amd64 (3001+ds-1, 3001.1+ds-1), linux-image-amd64:amd64 (5.6.14-2~bpo10+1, 5.7.10-1~bpo10+1), openmediavault:amd64 (5.5.6-1, 5.5.7-1)
End-Date: 2020-08-14  09:13:37

Start-Date: 2020-08-15  16:09:19
Commandline: apt-get --yes --allow-downgrades --allow-change-held-packages --fix-broken --fix-missing --auto-remove --allow-unauthenticated --show-upgraded --option DPkg::Options::=--force-confold install openmediavault
Upgrade: openmediavault:amd64 (5.5.7-1, 5.5.8-1)
Remove: linux-image-5.4.0-0.bpo.4-amd64:amd64 (5.4.19-1~bpo10+1)
End-Date: 2020-08-15  16:10:21

Add support for sql.gz in initdb.d

linuxserver.io

Hello, i am very excited about first run import feature. It works well with small sql files, but if you'd like to restore backups, you are in trouble (Maria DB does not support plain SQL files that are too long)

Expected Behavior

If it's possible, it would be great to support *.sql.zip and *.sql.gz files as well

Current Behavior

According to code, only *.sql files are supported

Environment

CPU architecture: arm64

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2020-05-28 21:26:47 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
OK

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


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is abc@localhost, it has no password either, but
you need to be the system 'abc' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2020-05-28 21:26:50 0 [Note] mysqld (mysqld 10.4.13-MariaDB-1:10.4.13+maria~bionic-log) starting as process 320 ...
2020-05-28 21:26:50 0 [Note] InnoDB: Using Linux native AIO
2020-05-28 21:26:50 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-28 21:26:50 0 [Note] InnoDB: Uses event mutexes
2020-05-28 21:26:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-28 21:26:50 0 [Note] InnoDB: Number of pools: 1
2020-05-28 21:26:50 0 [Note] InnoDB: Using generic crc32 instructions
2020-05-28 21:26:50 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-05-28 21:26:50 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-05-28 21:26:50 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-28 21:26:50 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-05-28 21:26:50 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-28 21:26:50 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-28 21:26:50 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-28 21:26:50 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-28 21:26:50 0 [Note] InnoDB: Waiting for purge to start
2020-05-28 21:26:50 0 [Note] InnoDB: 10.4.13 started; log sequence number 60972; transaction id 21
2020-05-28 21:26:50 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2020-05-28 21:26:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-28 21:26:50 0 [Note] InnoDB: Buffer pool(s) load completed at 200528 21:26:50
2020-05-28 21:26:50 0 [Note] Server socket created on IP: '::'.
2020-05-28 21:26:50 0 [Note] Reading of all Master_info entries succeeded
2020-05-28 21:26:50 0 [Note] Added new Master_info '' to hash table
**ERROR: 1105  Boostrap file error. Query size exceeded 20000 bytes near 'thing.</li>\r\n<li>The NAS will assign itself an IP address of <strong>192.168.11.150/24</strong>. You will need to set Windows to a static IP of <strong>192.168.11.1/24</strong> in order to serve up the TFTP Boot image.<br>To do this, open up <strong>'.**
2020-05-28 21:26:51 0 [Note] mysqld: ready for connections.
Version: '10.4.13-MariaDB-1:10.4.13+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2020-05-28 21:26:52 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2020-05-28 21:26:52 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-05-28 21:26:52 0 [Note] InnoDB: FTS optimize thread exiting.
2020-05-28 21:26:52 0 [Note] InnoDB: Starting shutdown...
2020-05-28 21:26:52 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
2020-05-28 21:26:52 0 [Note] InnoDB: Buffer pool(s) dump completed at 200528 21:26:52
2020-05-28 21:26:53 0 [Note] InnoDB: Shutdown completed; log sequence number 180444; transaction id 153
2020-05-28 21:26:53 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-05-28 21:26:53 0 [Note] mysqld: Shutdown complete

Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

/config/initdb.d/ sql script causes abnormal std output

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.

Adding a simple sql script to /config/initdb.d/ directory causes the server to output the following line every second:
2020-01-06 20:21:34 10 [Warning] Access denied for user 'root'@'localhost' (using password: NO)

It looks like it may be happening because it tries to restart the server.


Expected Behavior

Output I get when I run without the sql script in /config/initdb.d/

...
db    | 2020-01-06 20:03:11 0 [Note] mysqld: ready for connections.
db    | Version: '10.4.11-MariaDB-1:10.4.11+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
db    | 2020-01-06 20:03:12 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
db    | 2020-01-06 20:03:12 0 [Note] Event Scheduler: Purging the queue. 0 events
db    | 2020-01-06 20:03:12 0 [Note] InnoDB: FTS optimize thread exiting.
db    | 2020-01-06 20:03:12 0 [Note] InnoDB: Starting shutdown...
db    | 2020-01-06 20:03:12 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
db    | 2020-01-06 20:03:12 0 [Note] InnoDB: Buffer pool(s) dump completed at 200106 20:03:12
db    | 2020-01-06 20:03:14 0 [Note] InnoDB: Shutdown completed; log sequence number 60981; transaction id 24
db    | 2020-01-06 20:03:14 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db    | 2020-01-06 20:03:14 0 [Note] mysqld: Shutdown complete
db    | 
db    | Database Setup Completed
db    | [cont-init.d] 40-initialise-db: exited 0.
db    | [cont-init.d] 99-custom-scripts: executing... 
db    | [custom-init] no custom files found exiting...
db    | [cont-init.d] 99-custom-scripts: exited 0.
db    | [cont-init.d] done.
db    | [services.d] starting services
db    | [services.d] done.
...

Current Behavior

Output I get when I have a simple script to create a database and user:

...
db    | 2020-01-06 20:21:34 0 [Note] mysqld: ready for connections.
db    | Version: '10.4.11-MariaDB-1:10.4.11+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
db    | 2020-01-06 20:21:34 10 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:36 11 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:37 12 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:38 13 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:39 14 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:40 15 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:41 16 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:42 17 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:43 18 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:44 19 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:45 20 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:46 21 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:47 22 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:48 23 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:49 24 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:50 25 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:51 26 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:52 27 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:53 28 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:54 29 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
...

Steps to Reproduce

To reproduce, here is the docker-compose I'm using to test:

version: '3.4'    
    
services:    
  db:    
    image: linuxserver/mariadb    
    container_name: db    
    hostname: db    
    networks:    
      test_net:    
    environment:    
      - WIDELINKS    
      - TZ=America/Halifax    
      - USERID=1000    
      - GROUPID=1000    
      - MYSQL_ROOT_PASSWORD=secretpass    
    volumes:    
      - ./config:/config    
    ports:    
      - 3306:3306    
    restart: unless-stopped    
    
networks:    
  test_net: 

Then in same directory create a sql file:
config/initdb.d/add_db_and_user.sql

CREATE DATABASE IF NOT EXISTS `mydb` CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
CREATE USER 'mydbuser' @'172.%' IDENTIFIED BY 'asdf';
GRANT ALL PRIVILEGES ON mydb.* TO 'mydbuser' @'172.%';
FLUSH PRIVILEGES;

Environment

OS: Manjaro Linux 18.1.5
CPU architecture: x86_64
How docker service was installed: I don't recall but I think I used pacman.
docker version 19.03.5-ce, build 633a0ea838
docker-compose version 1.25.0, build unknown

Command used to create docker container (run/create/compose/screenshot)

see compose snippet above,
docker-compose pull
docker-compose up

Docker logs

Full log from startup to when I shut it down

Creating network "mariadbtest_test_net" with the default driver
Creating db ... done
Attaching to db
db    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
db    | [s6-init] ensuring user provided files have correct perms...exited 0.
db    | [fix-attrs.d] applying ownership & permissions fixes...
db    | [fix-attrs.d] done.
db    | [cont-init.d] executing container initialization scripts...
db    | [cont-init.d] 01-envfile: executing... 
db    | [cont-init.d] 01-envfile: exited 0.
db    | [cont-init.d] 10-adduser: executing... 
db    | usermod: no changes
db    | 
db    | -------------------------------------
db    |           _         ()
db    |          | |  ___   _    __
db    |          | | / __| | |  /  \ 
db    |          | | \__ \ | | | () |
db    |          |_| |___/ |_|  \__/
db    | 
db    | 
db    | Brought to you by linuxserver.io
db    | We gratefully accept donations at:
db    | https://www.linuxserver.io/donate/
db    | -------------------------------------
db    | GID/UID
db    | -------------------------------------
db    | 
db    | User uid:    911
db    | User gid:    911
db    | -------------------------------------
db    | 
db    | [cont-init.d] 10-adduser: exited 0.
db    | [cont-init.d] 30-config: executing... 
db    | [cont-init.d] 30-config: exited 0.
db    | [cont-init.d] 40-initialise-db: executing... 
db    | Setting Up Initial Databases
db    | Installing MariaDB/MySQL system tables in '/config/databases' ...
db    | 2020-01-06 20:21:31 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
db    | OK
db    | 
db    | To start mysqld at boot time you have to copy
db    | support-files/mysql.server to the right place for your system
db    | 
db    | 
db    | Two all-privilege accounts were created.
db    | One is root@localhost, it has no password, but you need to
db    | be system 'root' user to connect. Use, for example, sudo mysql
db    | The second is abc@localhost, it has no password either, but
db    | you need to be the system 'abc' user to connect.
db    | After connecting you can set the password, if you would need to be
db    | able to connect as any of these users with a password and without sudo
db    | 
db    | See the MariaDB Knowledgebase at http://mariadb.com/kb or the
db    | MySQL manual for more instructions.
db    | 
db    | You can start the MariaDB daemon with:
db    | cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'
db    | 
db    | You can test the MariaDB daemon with mysql-test-run.pl
db    | cd '/usr/mysql-test' ; perl mysql-test-run.pl
db    | 
db    | Please report any problems at http://mariadb.org/jira
db    | 
db    | The latest information about MariaDB is available at http://mariadb.org/.
db    | You can find additional information about the MySQL part at:
db    | http://dev.mysql.com
db    | Consider joining MariaDB's strong and vibrant community:
db    | https://mariadb.org/get-involved/
db    | 
db    | 2020-01-06 20:21:34 0 [Note] mysqld (mysqld 10.4.11-MariaDB-1:10.4.11+maria~bionic-log) starting as process 315 ...
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Using Linux native AIO
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Uses event mutexes
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Number of pools: 1
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Using SSE2 crc32 instructions
db    | 2020-01-06 20:21:34 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Completed initialization of buffer pool
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: 10.4.11 started; log sequence number 60972; transaction id 21
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
db    | 2020-01-06 20:21:34 0 [Note] Plugin 'FEEDBACK' is disabled.
db    | 2020-01-06 20:21:34 0 [Note] InnoDB: Buffer pool(s) load completed at 200106 20:21:34
db    | 2020-01-06 20:21:34 0 [Note] Server socket created on IP: '::'.
db    | 2020-01-06 20:21:34 0 [Note] Reading of all Master_info entries succeeded
db    | 2020-01-06 20:21:34 0 [Note] Added new Master_info '' to hash table
db    | 2020-01-06 20:21:34 0 [Note] mysqld: ready for connections.
db    | Version: '10.4.11-MariaDB-1:10.4.11+maria~bionic-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
db    | 2020-01-06 20:21:34 10 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:36 11 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:37 12 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:38 13 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:39 14 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:40 15 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:41 16 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:42 17 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:43 18 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:44 19 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:45 20 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:46 21 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:47 22 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:48 23 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:49 24 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:50 25 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:51 26 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:52 27 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:53 28 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:54 29 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | 2020-01-06 20:21:55 30 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
db    | [cont-finish.d] executing container finish scripts...
db    | [cont-finish.d] done.
db    | [s6-finish] waiting for services.
db    | [s6-finish] sending all processes the TERM signal.
db    | 
db    | Status information:
db    | 
db    | Current dir: /config/databases/
db    | Running threads: 5  Cached threads: 1  Stack size: 299008
db    | 
db    | Key caches:
db    | default
db    | Buffer_size:     134217728
db    | Block_size:           1024
db    | Division_limit:        100
db    | Age_threshold:         300
db    | Partitions:              0
db    | blocks used:             0
db    | not flushed:             0
db    | w_requests:              0
db    | writes:                  0
db    | r_requests:              0
db    | reads:                   0
db    | 
db    | 
db    | handler status:
db    | read_key:            7
db    | read_next:           0
db    | read_rnd             0
db    | read_first:          5
db    | write:               3
db    | delete               0
db    | update:              2
db    | 
db    | Table status:
db    | Opened tables:         17
db    | Open tables:           11
db    | Open files:            26
db    | Open streams:           0
db    | 
db    | Alarm status:
db    | Active alarms:   0
db    | Max used alarms: 0
db    | Next alarm time: 0
db    | 
db    | Memory status:
db    | Non-mmapped space allocated from system: 23937024
db    | Number of free chunks:                   46
db    | Number of fastbin blocks:                1
db    | Number of mmapped regions:               9
db    | Space in mmapped regions:                344383488
db    | Maximum total allocated space:           0
db    | Space available in freed fastbin blocks: 32
db    | Total allocated space:                   18569136
db    | Total free space:                        5367888
db    | Top-most, releasable space:              44752
db    | Estimated memory (with thread stack):    370114560
db    | Global memory allocated by server:       340129992
db    | Memory allocated by threads:             139800
db    | 
db    | 
db    | 
db    | Events status:
db    | LLA = Last Locked At  LUA = Last Unlocked At
db    | WOC = Waiting On Condition  DL = Data Locked
db    | 
db    | Event scheduler status:
db    | State      : INITIALIZED
db    | Thread id  : 0
db    | LLA        : n/a:0
db    | LUA        : n/a:0
db    | WOC        : NO
db    | Workers    : 0
db    | Executed   : 0
db    | Data locked: NO
db    | 
db    | Event queue status:
db    | Element count   : 0
db    | Data locked     : NO
db    | Attempting lock : NO
db    | LLA             : drop_schema_events:389
db    | LUA             : drop_schema_events:391
db    | WOC             : NO
db    | Next activation : never
db    | 2020-01-06 20:21:55 0 [Note] mysqld (initiated by: unknown): Normal shutdown
db    | 2020-01-06 20:21:55 0 [Note] Event Scheduler: Purging the queue. 0 events
db    | 2020-01-06 20:21:55 0 [Note] InnoDB: FTS optimize thread exiting.
db    | 2020-01-06 20:21:55 0 [Note] InnoDB: Starting shutdown...
db    | 2020-01-06 20:21:55 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
db    | 2020-01-06 20:21:55 0 [Note] InnoDB: Buffer pool(s) dump completed at 200106 20:21:55
db    | 2020-01-06 20:21:58 0 [Note] InnoDB: Shutdown completed; log sequence number 60981; transaction id 24
db    | 2020-01-06 20:21:58 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db    | 2020-01-06 20:21:58 0 [Note] mysqld: Shutdown complete
db    | 
db    | [s6-finish] sending all processes the KILL signal and exiting.
db exited with code 0

How do I update to 10.4?


name: update to 10.4 on ARMv7 (32Bit)


linuxserver.io


Desired Behavior

Update MariaDB for 32Bit Arm to 10.2 or higher

Current Behavior

my MariaDB says it has "Server version: 10.1.47-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04"
when logging in with docker exec -it mariadb mysql -p nextcloud
docker inspect -f '{{ index .Config.Labels "build_version" }}' mariadb
says
Linuxserver.io version:- 110.4.17mariabionic-ls7 Build-date:- 2021-01-16T06:29:38+00:00

Alternatives Considered

custom.cnf and log Folders Created as "root", not the user specified with PUID

Expected Behavior

The container should create all data and log files and folders under the user specified in the environment, and then start successfully.

Current Behavior

The container appears to create some files and folders under the specified user, while creating others as root:

.:
total 4
drwxrwxrwx+ 1 my-user users   44 Apr 11 14:28 .
drwxrwxrwx+ 1 my-user root    38 Apr 11 13:39 ..
-rwxrwxrwx+ 1 root    root  3779 Apr 11 14:28 custom.cnf
drwxrwxrwx+ 1 my-user root     0 Apr 11 14:28 databases
drwxrwxrwx+ 1 root    root    10 Apr 11 14:28 log

./databases:
total 0
drwxrwxrwx+ 1 my-user root   0 Apr 11 14:28 .
drwxrwxrwx+ 1 my-user users 44 Apr 11 14:28 ..

./log:
total 0
drwxrwxrwx+ 1 root    root  10 Apr 11 14:28 .
drwxrwxrwx+ 1 my-user users 44 Apr 11 14:28 ..
drwxrwxrwx  1 my-user users  0 Apr 11 14:28 mysql

./log/mysql:
total 0
drwxrwxrwx  1 my-user users  0 Apr 11 14:28 .
drwxrwxrwx+ 1 root    root  10 Apr 11 14:28 ..

Consequently, MariaDB fails to start:

2021-04-11 15:28:34 0 [Note] mysqld (mysqld 10.4.18-MariaDB-1:10.4.18+maria~bionic-log) starting as process 309 ...
2021-04-11 15:28:34 0 [ERROR] mysqld: File '/config/log/mysql/mariadb-bin.index' not found (Errcode: 13 "Permission denied")
2021-04-11 15:28:34 0 [ERROR] Aborting

Steps to Reproduce

  1. Create a user account on the host machine (e.g. my-user).
  2. Take note of the UID and GID of the user (id my-user). In my case, the UID of the user is 1028, and the GID is 100.
  3. Create a folder on the host machine (e.g. /volume1/MyApp/Database).
  4. Grant ownership of the folder to the new user (sudo chown -R my-user).
  5. Create a Docker container with the following set-up:
    • Environment:
      • MYSQL_USER: my-app
      • MYSQL_DATABASE: my-app`
      • TZ: America/New_York
      • PGID: 100
      • PUID: 1028
      • MYSQL_PASSWORD: MyPasswordForMyApp
      • MYSQL_ROOT_PASSWORD: MyRootPassword

Environment

OS: Linux (synology_geminilake_420)
CPU architecture: x86_64
How docker service was installed: Through Synology apps

Command used to create docker container (run/create/compose/screenshot)

Used Synology GUI. See repro steps above for all settings.

Docker inspect output:
2021-04-11 - docker inspect.json.txt

Docker logs

2021-04-11 - mariadb container log error.txt

ERROR 2002 (HY000): Can't connect to local MySQL server through socket

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

it supposed to run the script in the custom-cont-init.d folder

SCRIPT dump.sh
`#!/bin/sh

#start dump.sh
mysql -u root -p0000 -e "create database ubox2";
done
#end of dump.sh`

Current Behavior

[custom-init] files found in /config/custom-cont-init.d executing [custom-init] dump.sh: executing... ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") [custom-init] dump.sh: exited 1

Environment

**OS:RASPBEEY 3B+

Command used to create docker container (run/create/compose/screenshot)

dock-compose build
dock-compose up -d

Docker logs

`root@DietPi:/home/node_project# docker logs db-mariadb
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/

GID/UID

User uid: 911
User gid: 911

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2019-10-27 13:53:14 1995565888 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 258 ...
OK
Filling help tables...
2019-10-27 13:53:32 1996294976 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 287 ...
OK
Creating OpenGIS required SP-s...
2019-10-27 13:53:35 1995889472 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 317 ...
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 MariaDB 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 efc3dee8e5e3 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 MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2019-10-27 13:53:39 1996319552 [Note] mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 345 ...
Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] files found in /config/custom-cont-init.d executing
[custom-init] dump.sh: executing...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
[custom-init] dump.sh: exited 1
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
191027 13:53:44 mysqld_safe Logging to syslog.
191027 13:53:44 mysqld_safe Starting mysqld daemon with databases from /config/databases
`

Installation of system tables failed

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

MariaDB docker should start up and initialize the database.

Current Behavior

mysql is unable to install the system tables, and so I'm unable to connect to the MySQL. Trying the suggestions in the log don't help (running mysql_install_db --defaults-file=/config/custom.cnf fails with the same error message and mysql --skip-grant-tables --general-log exits with an error).

Steps to Reproduce

  1. startup

Environment

OS: Raspbian GNU/Linux 9
CPU architecture: arm32
How docker service was installed: by adding the appropriate lines to a yml file for docker-compose

Command used to create docker container (run/create/compose/screenshot)

docker-compose -f ~/linuxserver.yml up -d mariadb

where linuxserver.yml contains;

services:
  mariadb:
    image: linuxserver/mariadb
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=rootpass
      - TZ=America/New_York
    volumes:
      - /home/pi/appdata/mariadb:/config
    ports:
      - 3306:3306
    restart: unless-stopped

Docker logs

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing... 
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2020-09-10 16:37:49 1996041024 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 285 ...

Installation of system tables failed!  Examine the logs in
/config/databases for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /config/databases that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

2020-09-10 16:37:49 1995574080 [Note] mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 288 ...

Updates that include changes to config files.

There is a situation that has the potential to affect a lot of containers that update via apt.
From time to time part of the update involves a configuration file and if that file has been edited by setup in the docker, a question is asked about how to proceed.

ie, keep the existing setup, replace the setup etc.....

if the question is unanswered, as it would be in the current method of apt updating, the container exits 100 out of the apt update routine and stops.

If -o Dpkg::Options::="--force-confold" is used, then mariadb in particular still exits with an error during the apt update routine, claiming mariadb is not configured.

if -o Dpkg::Options::="--force-confnew" is used, it obviously overwrites existing configs, bringing possible issues with settings made to the docker for our abc user for example.
that can be mitigated with reaffirming the settings at run time, but there is e potential pitfall with using the new config file... if the changes to the config file were part of the fix, local copies of the config file in /config could overwrite the changed file.

Feature Request: add env variable to change mariadb port

Hello,

I have couple instances of the mariadb database where they use host IP:

docker-compose.yml:

network_mode: host

I would like to be able to change mariadb port via environment variable rather then editing it in its config file every time:

[mysqld]
port                = 33061

So it will spin up database directly using e.g. 33061.

I found something on stackoverflow but it did not work:

- MYSQL_TCP_PORT=33061
- MYSQL_UNIX_PORT=33061

Thanks, will be appreciated. Michal

Error creating databases

linuxserver.io


Expected Behavior

Initialize correctly and create database

Current Behavior

Creates container but doesn't create database

Steps to Reproduce

  1. Install docker and docker-compose on system.
  2. Create docker-compose.yml file with the linuxserver/docker-mariadb:alpine-10.5.9-r0-ls8 service.
  3. Start the container.

Environment

OS: Ubuntu 20.04.2 LTS (focal)
CPU architecture: x86_64
How docker service was installed:

Installed docker and docker-compose via the official manual, get-docker.sh script and docker-compose from their github page.

Command used to create docker container (run/create/compose/screenshot)

Created with docker-compose.yml:

version: "2.1"
services:

  mariadb:
    image: ghcr.io/linuxserver/mariadb:alpine-10.5.9-r0-ls8
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=pass
      - TZ=Europe/Budapest
      - MYSQL_DATABASE=database
      - MYSQL_USER=user
      - MYSQL_PASSWORD=pass
    volumes:
      - ./mariadb:/config
    restart: always

Starting command:

docker-compose up -d

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
/var/run/s6/etc/cont-init.d/40-initialise-db: line 27: /tmp/tmp.dm4tBw1LTl: Permission denied
/var/run/s6/etc/cont-init.d/40-initialise-db: line 71: /tmp/tmp.dm4tBw1LTl: Permission denied
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2021-03-31 10:19:22 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
OK

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


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is abc@localhost, it has no password either, but
you need to be the system 'abc' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at https://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.
You can find additional information about the MySQL part at:
https://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2021-03-31 10:19:22 0 [Note] mysqld (mysqld 10.5.9-MariaDB-log) starting as process 301 ...
2021-03-31 10:19:22 0 [Note] InnoDB: Uses event mutexes
2021-03-31 10:19:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-31 10:19:22 0 [Note] InnoDB: Number of pools: 1
2021-03-31 10:19:22 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-03-31 10:19:22 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2021-03-31 10:19:22 0 [Note] InnoDB: Using Linux native AIO
2021-03-31 10:19:22 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2021-03-31 10:19:22 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-31 10:19:22 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-31 10:19:22 0 [Note] InnoDB: 128 rollback segments are active.
2021-03-31 10:19:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-31 10:19:22 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-31 10:19:22 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-31 10:19:22 0 [Note] InnoDB: 10.5.9 started; log sequence number 45118; transaction id 20
2021-03-31 10:19:22 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-03-31 10:19:22 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2021-03-31 10:19:22 0 [Note] InnoDB: Buffer pool(s) load completed at 210331 10:19:22
2021-03-31 10:19:22 0 [Note] Server socket created on IP: '::'.
2021-03-31 10:19:22 0 [Note] Reading of all Master_info entries succeeded
2021-03-31 10:19:22 0 [Note] Added new Master_info '' to hash table
2021-03-31 10:19:22 0 [Note] mysqld: ready for connections.
Version: '10.5.9-MariaDB-log'  socket: '/run/mysqld/mysqld.sock'  port: 3306  MariaDB Server
2021-03-31 10:19:24 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2021-03-31 10:19:24 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-03-31 10:19:24 0 [Note] InnoDB: FTS optimize thread exiting.
2021-03-31 10:19:24 0 [Note] InnoDB: Starting shutdown...
2021-03-31 10:19:24 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
2021-03-31 10:19:24 0 [Note] InnoDB: Buffer pool(s) dump completed at 210331 10:19:24
2021-03-31 10:19:24 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-03-31 10:19:24 0 [Note] InnoDB: Shutdown completed; log sequence number 45130; transaction id 21
2021-03-31 10:19:24 0 [Note] mysqld: Shutdown complete

Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
210331 10:19:25 mysqld_safe Logging to '/config/databases/60ae7d0838f5.err'.
210331 10:19:25 mysqld_safe Starting mariadbd daemon with databases from /config/databases

Use the architecture specific Apkindex for armhf and aarch64

linuxserver.io


Expected Behavior

Dockerfile uses the architecture specific Apkindex when building armhf and aarch64.

Current Behavior

When building the images without sepcifying the MARIADB_VERSION, the version is beeing querried from the Apkindex of the x86_64 architecture, independently from the actual architecture being built for.

Steps to Reproduce

  1. Build the image without specifying MARIADB_VERSION

Environment

OS: any
CPU architecture: arm32/arm64
How docker service was installed:

Definer does not exist error

root@mariadb:/# whoami                                                                                                        
root                                                                                                                          
root@mariadb:/# mysql -u root -p                                                                                              
Enter password:                                                                                                               
Welcome to the MariaDB monitor.  Commands end with ; or \g.                                                                   
Your MariaDB connection id is 9                                                                                               
Server version: 10.4.13-MariaDB-1:10.4.13+maria~bionic-log mariadb.org binary distribution                                    
                                                                                                                              
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.                                                          
                                                                                                                              
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.                                                
                                                                                                                              
MariaDB [(none)]> select user from mysql.user;                                                                                
ERROR 1449 (HY000): The user specified as a definer ('mariadb.sys'@'localhost') does not exist                                


Expected Behavior

shown above is the first start. the command should list the users

Current Behavior

see error above. this is a container on Synology Nas 218+ with only the MYSQL_ROOT_PASSWORD variable set when the container was created to eliminate any other conflicts/issues.

Environment

**OS: Synology NAS 218+ Docker
CPU architecture: x86_64

Cannot connect to the mariadb database rpi4

Hello,
I am trying desperately to connect to the mariadb database on raspberry pi 4 but I cannot.
When I try to log into mariadb :

docker-compose up -d
Creating mariadb ... done
docker exec -it mariadb mysql -h 127.0.0.1 -P 3306 -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)

ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)

However my docker-compose.yml is extremely simple :

version:` "2.1"
services:
  mariadb:
    image: ghcr.io/linuxserver/mariadb
    container_name: mariadb
    networks:
      - backend
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
    volumes:
      - /home/peter/docker/mariadb/config:/config
    ports:
      - 3306:3306
    restart: unless-stopped
networks:
    backend:
        name: backend
        external: true

I am currently on raspberry pi 4 :

uname -a
Linux monmaria 5.10.60-v7l+ #1449 SMP Wed Aug 25 15:00:44 BST 2021 armv7l GNU/Linux

Version de Debian
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

Do you need more information ?
Do you have any idea what I'm doing wrong?

thanks in advance

Rudy

database not created during setup

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

EXPECTS DATABASE TO BE CREATED UBOX2

Current Behavior

DATABASE NOT CREATED

Steps to Reproduce

docker-compose.yaml

version: '3'

services:
  mariadb:
    build:
      context: ./db
      dockerfile: mariadb.Dockerfile
    container_name: db-mariadb
    restart: unless-stopped
    ports:
      - "3306:3306"
    environment:
      TZ: Europe/London
      MYSQL_USER: root
      MYSQL_DATABASE: ubox2
      MYSQL_PASSWORD: 8619
      MYSQL_ROOT_PASSWORD: 8619
    volumes:
      - ${PWD}
    networks:
      - app-network

mariadb.Dockerfile

# ---- Base Node ----
FROM linuxserver/mariadb

Environment

OS: RASPBERRY 3B+

Command used to create docker container (run/create/compose/screenshot)

docker-compose build
docker-compose up -d

Docker logs

# docker logs db-mariadb
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2019-10-27 19:39:40 1996380992 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 259 ...
OK
Filling help tables...
2019-10-27 19:39:59 1995832128 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 288 ...
OK
Creating OpenGIS required SP-s...
2019-10-27 19:40:02 1996282688 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 318 ...
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 MariaDB 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 03556619ee30 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 MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2019-10-27 19:40:05 1995979584 [Note] mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 346 ...
Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
191027 19:40:12 mysqld_safe Logging to syslog.
191027 19:40:12 mysqld_safe Starting mysqld daemon with databases from /config/databases

root@DietPi:/home/node_project# docker exec -it db-mariadb mysql -uroot -p8619
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.41-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)

MariaDB [(none)]>

DATABASE UBOX2 NOT CREATED

Does this image support usage of /docker-entrypoint-initdb.d/?

Hi!

I've found this image as an alternative to regular mariadb images, since my target requires running on ARM architecture, but I've come into an issue that it is not exactly a drop in replacement for original mariadb image. Question stands: Does this image support usage of /docker-entrypoint-initdb.d/, where any provided bash and sql scripts would be executed? If not, is there an alternative for such behavior?

References:
https://hub.docker.com/_/mariadb#initializing-a-fresh-instance

Unable to set max_allowed_packet

Setting max_allowed_packet in docker command results in
unknown flag: --max_allowed_packet

Here is run command

`root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='mariadb' --net='eth0' --ip='10.100.0.3' --log-opt max-size='50m' --log-opt max-file='1' -e TZ="America/New_York" -e HOST_OS="Unraid" -e 'TCP_PORT_3306'='3306' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/mariadb':'/config':'rw' --max_allowed_packet=64M 'linuxserver/mariadb'
unknown flag: --max_allowed_packet
See 'docker run --help'.

The command failed.`

Expected max_allowed_packet size to increase to 64M instead of default 16M

Setting up galera on rpi

i'm trying to setup a galera cluster using my pc and my raspberry3b+
My pc acts as node1 (non docker system)
raspberry3b+ is node2 (docker system)

galera config on node1

[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0 

# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so

# Galera Cluster Configuration
wsrep_cluster_name="test_cluster"
wsrep_cluster_address="gcomm://192.168.43.24"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="192.168.43.208"
wsrep_node_name="VM_Dietpi"
root@DietPi:~#
root@DietPi:~#
root@DietPi:~# sudo galera_new_cluster
root@DietPi:~#
root@DietPi:~#
root@DietPi:~#
root@DietPi:~#
root@DietPi:~# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.29 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-07-25 22:51:12 BST; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 1062 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
  Process: 1063 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1066 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=
0/SUCCESS)
  Process: 1217 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1219 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
 Main PID: 1181 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 36 (limit: 5050)
   Memory: 108.2M
   CGroup: /system.slice/mariadb.service
           └─1181 /usr/sbin/mysqld --wsrep-new-cluster --wsrep_start_position=d6c34243-e889-11eb-ac33-63d984b00e8e:0

Jul 25 22:51:09 DietPi systemd[1]: Starting MariaDB 10.3.29 database server...
Jul 25 22:51:12 DietPi sh[1066]: WSREP: Recovered position d6c34243-e889-11eb-ac33-63d984b00e8e:0
Jul 25 22:51:12 DietPi mysqld[1181]: 2021-07-25 22:51:12 0 [Note] /usr/sbin/mysqld (mysqld 10.3.29-MariaDB-0+deb10u1) starting as process 1181 ...
Jul 25 22:51:12 DietPi systemd[1]: Started MariaDB 10.3.29 database server.
Jul 25 22:51:12 DietPi /etc/mysql/debian-start[1221]: Upgrading MySQL tables if necessary.
root@DietPi:~#

galera config on node2

[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0 

# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so

# Galera Cluster Configuration
wsrep_cluster_name="test_cluster"
wsrep_cluster_address="gcomm://192.168.43.208"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="192.168.43.24"
wsrep_node_name="Local_Dietpi"
root@DietPi:/home/dietpi/docker-mariadb# docker-compose up
Starting mariadb ... done
Attaching to mariadb
mariadb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
mariadb    | [s6-init] ensuring user provided files have correct perms...exited 0.
mariadb    | [fix-attrs.d] applying ownership & permissions fixes...
mariadb    | [fix-attrs.d] done.
mariadb    | [cont-init.d] executing container initialization scripts...
mariadb    | [cont-init.d] 01-envfile: executing...
mariadb    | [cont-init.d] 01-envfile: exited 0.
mariadb    | [cont-init.d] 10-adduser: executing...
mariadb    | usermod: no changes
mariadb    |
mariadb    | -------------------------------------
mariadb    |           _         ()
mariadb    |          | |  ___   _    __
mariadb    |          | | / __| | |  /  \
mariadb    |          | | \__ \ | | | () |
mariadb    |          |_| |___/ |_|  \__/
mariadb    |
mariadb    |
mariadb    | Brought to you by linuxserver.io
mariadb    | -------------------------------------
mariadb    |
mariadb    | To support LSIO projects visit:
mariadb    | https://www.linuxserver.io/donate/
mariadb    | -------------------------------------
mariadb    | GID/UID
mariadb    | -------------------------------------
mariadb    |
mariadb    | User uid:    1000
mariadb    | User gid:    1000
mariadb    | -------------------------------------
mariadb    |
mariadb    | [cont-init.d] 10-adduser: exited 0.
mariadb    | [cont-init.d] 30-config: executing...
mariadb    | [cont-init.d] 30-config: exited 0.
mariadb    | [cont-init.d] 40-initialise-db: executing...
mariadb    | [cont-init.d] 40-initialise-db: exited 0.
mariadb    | [cont-init.d] 90-custom-folders: executing...
mariadb    | [cont-init.d] 90-custom-folders: exited 0.
mariadb    | [cont-init.d] 90-warning: executing...
mariadb    |
mariadb    | ******************************************************
mariadb    | ******************************************************
mariadb    | *                                                    *
mariadb    | *                                                    *
mariadb    | *          This image will soon be rebased           *
mariadb    | *               from ubuntu to alpine.               *
mariadb    | *       Please be aware, this may cause issues       *
mariadb    | *     It is strongly recommended to make backups     *
mariadb    | *         of your config and databases before        *
mariadb    | *       updating your image to the alpine base.      *
mariadb    | *                                                    *
mariadb    | *                                                    *
mariadb    | ******************************************************
mariadb    | ******************************************************
mariadb    | [cont-init.d] 90-warning: exited 0.
mariadb    | [cont-init.d] 99-custom-scripts: executing...
mariadb    | [custom-init] no custom files found exiting...
mariadb    | [cont-init.d] 99-custom-scripts: exited 0.
mariadb    | [cont-init.d] done.
mariadb    | [services.d] starting services
mariadb    | [services.d] done.
mariadb    | 210725 17:41:10 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:10 mysqld_safe Starting mysqld daemon with databases from /config/databases

mariadb    | 210725 17:41:12 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:12 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:14 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:15 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:17 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:17 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:19 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:19 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:21 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:21 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:23 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:24 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:26 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:26 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb    | 210725 17:41:28 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:28 mysqld_safe Starting mysqld daemon with databases from /config/databases


Expected Behavior

root@DietPi:~#
root@DietPi:~# mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
Enter password:
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 2     |
+--------------------+-------+
root@DietPi:~#

Current Behavior

everytime i add galera cnf to node2, it doesnt startup properly.. all i get is a repeated loop of

mariadb    | 210725 17:41:28 mysqld_safe Logging to syslog.
mariadb    | 210725 17:41:28 mysqld_safe Starting mysqld daemon with databases from /config/databases

and galera doesnt work

root@DietPi:~#
root@DietPi:~# mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
Enter password:
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 1     |
+--------------------+-------+
root@DietPi:~#

Environment

OS: Dietpi
CPU architecture: arm32

Why not update MariaDB armhf image to 10.3.27?

I know there are multiple closed issues about that #68 #62 #60 #47 and #45
But - actually there is mariadb armhf build available in version 10.3. When I install it from official Raspbian Buster repository, I get mariadb server 10.3.27. So what's the actual problem? Why we can't update mariadb linuxserver armhf image to 10.3?

The reason why I'm asking is that I'm using Nextcloud and they stop support mariadb 10.1 very soon.

Latest builds failing

linuxserver.io

Ubuntu 18.04

mariadb:
image: linuxserver/mariadb:latest
container_name: mariadb
environment:
- TZ=America/Chicago
- PGID=1000
- PUID=1000
- MYSQL_ROOT_PASSWORD=password
ports:
- 3306:3306
volumes:
- /docker/containers/mariadb:/config
restart: unless-stopped

Prior verions would fire off initialise, latest version fails as there is no mysql installed it says. If I go into the container, mysql said command can't be found.

latest:

sed: can't read /etc/mysql/my.cnf: No such file or directory
sed: can't read /etc/mysql/my.cnf: No such file or directory
sed: can't read /etc/mysql/my.cnf: No such file or directory
sed: can't read /etc/mysql/my.cnf: No such file or directory
sed: can't read /etc/mysql/my.cnf: No such file or directory
sed: can't read /usr/bin/mysqld_safe: No such file or directory
ln: failed to create symbolic link '/etc/mysql/conf.d/custom.cnf': No such file or directory
/var/run/s6/etc/cont-init.d/40-initialise-db: line 60: mysql_install_db: command not found
/var/run/s6/etc/cont-init.d/40-initialise-db: line 5: mysqld: command not found 

Thanks, team linuxserver.io

Internal port different from 3306

linuxserver.io


Expected Behavior

By setting ports: 3307:3307 I expect the db to be internally accessible in 3307
I even tried to set the env MYSQL_TCP_PORT to 3307, without success

Current Behavior

The db container is still only accessible at port 3306

Steps to Reproduce

  1. Set internal port to 3307
  2. Try to access the db from another container using port 3307
  3. In docker-compose have two containers with image: ghcr.io/linuxserver/mariadb, the first one with port 3306 the second with port 3307

Environment

OS: any
CPU architecture: x86_64/arm32/arm64

Running the container enters an infinite loop

When I run the container (latest tag) with the following command:

docker run --name=mariadb -p 3307:3306 -e PUID=1000 -e PGID=1000 -e MYSQL_ROOT_PASSWORD=xxxxx -e TZ=Europe/Amsterdam -v /srv/services/mariadb:/config linuxserver/mariadb

It enters an endless loop; please see the logs here:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30_config: executing...
[cont-init.d] 30_config: exited 0.
[cont-init.d] 40-initialise-db: executing...
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
180911 16:44:41 mysqld_safe Logging to syslog.
180911 16:44:41 mysqld_safe Starting mysqld daemon with databases from /config/databases
180911 16:44:45 mysqld_safe Logging to syslog.
180911 16:44:45 mysqld_safe Starting mysqld daemon with databases from /config/databases
180911 16:44:48 mysqld_safe Logging to syslog.
180911 16:44:48 mysqld_safe Starting mysqld daemon with databases from /config/databases
180911 16:44:51 mysqld_safe Logging to syslog.
180911 16:44:51 mysqld_safe Starting mysqld daemon with databases from /config/databases
180911 16:44:54 mysqld_safe Logging to syslog.
180911 16:44:54 mysqld_safe Starting mysqld daemon with databases from /config/databases
180911 16:44:57 mysqld_safe Logging to syslog.

Initdb script permission error on Alpine

linuxserver.io


Expected Behavior

SQL scripts under initdb.d applied.

Current Behavior

Scripts are not executed.

Steps to Reproduce

  1. Place a script on /config/initdb.d
  2. docker-compose up

Environment

OS: Ubuntu 21.04
CPU architecture: x86_64
How docker service was installed: regular apt installation.

Command used to create docker container (run/create/compose/screenshot)

Docker logs

mariadb     | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
mariadb     | [s6-init] ensuring user provided files have correct perms...exited 0.
mariadb     | [fix-attrs.d] applying ownership & permissions fixes...
mariadb     | [fix-attrs.d] done.
mariadb     | [cont-init.d] executing container initialization scripts...
mariadb     | [cont-init.d] 01-envfile: executing...
mariadb     | [cont-init.d] 01-envfile: exited 0.
mariadb     | [cont-init.d] 10-adduser: executing...
mariadb     |
mariadb     | -------------------------------------
mariadb     |           _         ()
mariadb     |          | |  ___   _    __
mariadb     |          | | / __| | |  /  \
mariadb     |          | | \__ \ | | | () |
mariadb     |          |_| |___/ |_|  \__/
mariadb     |
mariadb     |
mariadb     | Brought to you by linuxserver.io
mariadb     | -------------------------------------
mariadb     |
mariadb     | To support LSIO projects visit:
mariadb     | https://www.linuxserver.io/donate/
mariadb     | -------------------------------------
mariadb     | GID/UID
mariadb     | -------------------------------------
mariadb     |
mariadb     | User uid:    1000
mariadb     | User gid:    1000
mariadb     | -------------------------------------
mariadb     |
mariadb     | [cont-init.d] 10-adduser: exited 0.
mariadb     | [cont-init.d] 30-config: executing...
mariadb     | [cont-init.d] 30-config: exited 0.
mariadb     | [cont-init.d] 40-initialise-db: executing...
mariadb     | Setting Up Initial Databases
mariadb     | /var/run/s6/etc/cont-init.d/40-initialise-db: line 81: /tmp/tmp.wY0vav5sNi: Permission denied
mariadb     | Installing MariaDB/MySQL system tables in '/config/databases' ...
mariadb     | 2021-06-25  9:47:21 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
mariadb     | OK

MariaDB update to 10.2 or higher

linuxserver.io


Desired Behavior

I use this image together with nextcloud and nextcloud is telling me I should update from mariadb 10.1 to 10.2 or higher.
Is it possible to update mariadb inside the container or could you create an updated image?

Current Behavior

Alternatives Considered

Bootstrapping of database with .sql files in /config/initdb.d/ not working as intended

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

When a .sql file is mounted at /config/initdb.d/ the container should run the SQL-script inside the default database created using the environment variables. This would be consistent with how the official mariadb container works for .sql scripts mounted at /docker-entrypoint-initdb.d (please see part "Initializing a fresh instance" in above linked doc).

Current Behavior

Currently the script /etc/cont-init.d/40-initialise-db which creates the SQL init script /tmp/mysql-first-time.sql doesn't add a USE ${MYSQL_DATABASE} after setting up the initial databases and before adding the init and remote sql scripts. This causes the scripts to fail if they don't contain a USE clause at the beginning of them. This is not intended, because the idea of providing the database details with environment variables is to select the database name dynamically and not having to modify the source SQL files based on the value of ENV MYSQL_DATABASE.

Steps to Reproduce

  1. Run the container with any database name, username and password, and gammu.sql mounted at /config/initdb.d/gammu.sql.
  2. Open a shell to the container
  3. Run mysql -uroot -prootPass
  4. Run USE abc; with the abc being the database name you gave it as ENV
  5. Run SHOW TABLES; and you'll get an empty set.

Everything works if you manually do mysql -uroot -prootPass abc < /config/initdb.d/gammu.sql

Environment

OS: Raspbian GNU/Linux 10 (buster) (Linux raspi3-gammu01 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux)
CPU architecture: armv7l
How docker service was installed: Using the script as instructed by Docker docs.

Command used to create docker container (run/create/compose/screenshot)

version: "3.7"

services:
  gammu-db:
    image: linuxserver/mariadb
    restart: unless-stopped
    env_file:
      - ./gammu-db-config.env
    volumes:
      - gammu-db:/config/databases
      - ./gammu.sql:/config/initdb.d/gammu.sql
    networks:
      - db-gammu

networks:
  db-gammu:

volumes:
  gammu-db:

The ./gammu-db-config.env contents:

MYSQL_ROOT_PASSWORD=rootPass
TZ=Europe/Helsinki

MYSQL_DATABASE=gammu
MYSQL_USER=gammu
MYSQL_PASSWORD=pass

Docker logs

gammu-db_1            | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
gammu-db_1            | [s6-init] ensuring user provided files have correct perms...exited 0.
gammu-db_1            | [fix-attrs.d] applying ownership & permissions fixes...
gammu-db_1            | [fix-attrs.d] done.
gammu-db_1            | [cont-init.d] executing container initialization scripts...
gammu-db_1            | [cont-init.d] 01-envfile: executing...
gammu-db_1            | [cont-init.d] 01-envfile: exited 0.
gammu-db_1            | [cont-init.d] 10-adduser: executing...
gammu-db_1            | usermod: no changes
gammu-db_1            |
gammu-db_1            | -------------------------------------
gammu-db_1            |           _         ()
gammu-db_1            |          | |  ___   _    __
gammu-db_1            |          | | / __| | |  /  \
gammu-db_1            |          | | \__ \ | | | () |
gammu-db_1            |          |_| |___/ |_|  \__/
gammu-db_1            |
gammu-db_1            |
gammu-db_1            | Brought to you by linuxserver.io
gammu-db_1            | We gratefully accept donations at:
gammu-db_1            | https://www.linuxserver.io/donate/
gammu-db_1            | -------------------------------------
gammu-db_1            | GID/UID
gammu-db_1            | -------------------------------------
gammu-db_1            |
gammu-db_1            | User uid:    911
gammu-db_1            | User gid:    911
gammu-db_1            | -------------------------------------
gammu-db_1            |
gammu-db_1            | [cont-init.d] 10-adduser: exited 0.
gammu-db_1            | [cont-init.d] 30-config: executing...
gammu-db_1            | [cont-init.d] 30-config: exited 0.
gammu-db_1            | [cont-init.d] 40-initialise-db: executing...
gammu-db_1            | Setting Up Initial Databases
gammu-db_1            | Installing MariaDB/MySQL system tables in '/config/databases' ...
gammu-db_1            | 2020-03-12 19:31:10 1996028736 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 278 ...
gammu-db_1            | OK
gammu-db_1            | Filling help tables...
gammu-db_1            | 2020-03-12 19:31:43 1996397376 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 307 ...
gammu-db_1            | OK
gammu-db_1            | Creating OpenGIS required SP-s...
gammu-db_1            | 2020-03-12 19:31:47 1995729728 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 337 ...
gammu-db_1            | OK
gammu-db_1            |
gammu-db_1            | To start mysqld at boot time you have to copy
gammu-db_1            | support-files/mysql.server to the right place for your system
gammu-db_1            |
gammu-db_1            | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
gammu-db_1            | To do so, start the server, then issue the following commands:
gammu-db_1            |
gammu-db_1            | '/usr/bin/mysqladmin' -u root password 'new-password'
gammu-db_1            | '/usr/bin/mysqladmin' -u root -h d8b04b78a2c2 password 'new-password'
gammu-db_1            |
gammu-db_1            | Alternatively you can run:
gammu-db_1            | '/usr/bin/mysql_secure_installation'
gammu-db_1            |
gammu-db_1            | which will also give you the option of removing the test
gammu-db_1            | databases and anonymous user created by default.  This is
gammu-db_1            | strongly recommended for production servers.
gammu-db_1            |
gammu-db_1            | See the MariaDB Knowledgebase at http://mariadb.com/kb or the
gammu-db_1            | MySQL manual for more instructions.
gammu-db_1            |
gammu-db_1            | You can start the MariaDB daemon with:
gammu-db_1            | cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'
gammu-db_1            |
gammu-db_1            | You can test the MariaDB daemon with mysql-test-run.pl
gammu-db_1            | cd '/usr/mysql-test' ; perl mysql-test-run.pl
gammu-db_1            |
gammu-db_1            | Please report any problems at http://mariadb.org/jira
gammu-db_1            |
gammu-db_1            | The latest information about MariaDB is available at http://mariadb.org/.
gammu-db_1            | You can find additional information about the MySQL part at:
gammu-db_1            | http://dev.mysql.com
gammu-db_1            | Consider joining MariaDB's strong and vibrant community:
gammu-db_1            | https://mariadb.org/get-involved/
gammu-db_1            |
gammu-db_1            | 2020-03-12 19:31:50 1996397376 [Note] mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 365 ...
gammu-db_1            | Database Setup Completed
gammu-db_1            | [cont-init.d] 40-initialise-db: exited 0.
gammu-db_1            | [cont-init.d] 99-custom-scripts: executing...
gammu-db_1            | [custom-init] no custom files found exiting...
gammu-db_1            | [cont-init.d] 99-custom-scripts: exited 0.
gammu-db_1            | [cont-init.d] done.
gammu-db_1            | [services.d] starting services
gammu-db_1            | [services.d] done.
gammu-db_1            | 200312 19:31:56 mysqld_safe Logging to syslog.
gammu-db_1            | 200312 19:31:56 mysqld_safe Starting mysqld daemon with databases from /config/databases

I'll create a pull request to be linked with this issue.

single quote/apostrophe in password via compose causes cont scripts to fail

If you have an apostrophe in your password string, this will cause our initialization scripts to fail in their running and leave the system without a root account if on the root password or the user created account if there.

We can add

dev ~ # echo $MYSQL_ROOT_PASSWORD
blah'blah'fucking'blah'
dev ~ # sed 's#'\''#\\'\''#g' <<<"$MYSQL_ROOT_PASSWORD"
blah\'blah\'fucking\'blah\'

something like this after

if [ -z "$MYSQL_ROOT_PASSWORD" ]; then
TEST_LEN="0"
else
TEST_LEN=${#MYSQL_ROOT_PASSWORD}
fi

and again
[ "${#MYSQL_PASSWORD}" -gt "3" ]; then

to potentially resolve the issue.

untested.

using experimental guides on nextcloud results in mariadb not starting.

linuxserver.io

<--- Host OS -->
unRaid 6.5.3

<--- Command line users, your run/create command, GUI/Unraid users, a screenshot of your template settings. -->
image

Alright, after testing...
The linuxserver/mariadb version 136 corrupts a database if you're updating, in my case from version 135.
The converted version 136 database cannot be taken back to linuxserver/mariadb:135, it'll fail to load.
Backups of linuxserver/mariadb:135 databases will be corrupted on load.
Running a clean linuxserver/mariadb:136 is fine, it seems to create and run a new database fine.

My current conclusion, linuxserver/mariadb:136 will cause complete data lose if you attempt to update to it. It should be avoided if you currently use linuxserver/mariadb:135

armhf alpine - docker container high CPU usage

linuxserver.io


Expected Behavior

Normal CPU usage.

Current Behavior

100% CPU usage when idle.

Steps to Reproduce

  1. Create docker-compose.yml and paste the contents of the below yml config
  2. Start with docker-compose up
  3. Notice that fresh container, without any databases and connections, consumes 100% of CPU.

This behavior seems to affect only the new alpine image, previous image was working perfectly fine.

Environment

OS: Raspbian Buster
CPU architecture: arm32
docker-compose
Docker version 20.10.3
libseccomp2.4.4

Command used to create docker container (run/create/compose/screenshot)

version: "2.2"
services:
  mariadb:
    image: ghcr.io/linuxserver/mariadb:alpine
    environment:
      - PUID=1001
      - PGID=1001
      - MYSQL_ROOT_PASSWORD=1234
      - TZ=Europe/Warsaw
      - MYSQL_USER=su
      - MYSQL_PASSWORD=1234
    restart: unless-stopped

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1001
User gid:    1001
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
210215 20:18:16 mysqld_safe Logging to '/config/databases/a7fb56d21764.err'.
210215 20:18:16 mysqld_safe Starting mariadbd daemon with databases from /config/databases

Rebase this image on alpine?

Hey all,

Would it be possible to rebase this image on Alpine, just like The Lounge ? I quite like the small size and automated permissions handling of s6 (especially for toying with Docker and volumes).

Thanks in advance!

Expect v10.4 but get v.10.1.44

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Expect to have version 10.4.x installed when pulling the latest tag of the container

Current Behavior

mariadb runs perfectly, but is the wrong version

mariadb --version
outputs
mariadb Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2

Steps to Reproduce

Install linuxserver/mariadb:latest

Environment

OS: Raspbian Buster
CPU architecture: arm32
How docker service was installed:
Using the Nomad Docker driver.

Command used to create docker container (run/create/compose/screenshot)

Nomad task template:

  task "mariaDB" {
      env {
        PUID = "1000"
        PGID = "1000"
        MYSQL_ROOT_PASSWORD = "[redacted]"
        TZ = "America/New_York"
        MYSQL_USER = "[redacted]"
        MYSQL_PASSWORD = "[redacted]"
      }
      driver = "docker"
      config {
        image = "linuxserver/mariadb:latest"
        hostname = "mariadb"
        volumes = [
          "/mnt/usbDrive/docker/mariaDB:/config"
        ]
        port_map {
          db = 3306
        }
      }

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
200226 09:45:51 mysqld_safe Logging to syslog.
200226 09:45:51 mysqld_safe Starting mysqld daemon with databases from /config/databases

stderr is empty, thankfully.

Fails to install on WD EX4100 NAS - Segmentation Fault

The NAS
The NAS has a Marvell Armada 388 processor, which is a dual core based on the Arm v7 design.

It is running OS5, with the latest patch, and has Docker v19.03.13, as found here, installed.

The plan
Trying to get a dockerised NextCloud installed, I planned for

  • The official NextCloud image
  • This MariaDB image
  • Redis official image
  • Reverse Proxy (httpd)
  • Let's encrypt (lsioarmhf/letsencrypt)

The Work Around

  • When Mariadb did not work, I tried the latest official Postgres image, which I had no issues with.

Percieved problem with this image
Running the image results in a Segmentation Fault at the stage of, "Installing MariaDB/MySQL system tables in '/config/databases' "

Runtime Log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 01-envfile: executing... ,
[cont-init.d] 01-envfile: exited 0.,
[cont-init.d] 10-adduser: executing... ,
usermod: no changes,
,
-------------------------------------,
_ (),
| | ___ _ _,
| | / | | | / \ ,
| | _
\ | | | () |,
|| |
/ || _/,
,
,
Brought to you by linuxserver.io,
-------------------------------------,
,
To support LSIO projects visit:,
https://www.linuxserver.io/donate/,
-------------------------------------,
GID/UID,
-------------------------------------,
,
User uid: 911,
User gid: 911,
-------------------------------------,
,
[cont-init.d] 10-adduser: exited 0.,
[cont-init.d] 30-config: executing... ,
[cont-init.d] 30-config: exited 0.,
[cont-init.d] 40-initialise-db: executing... ,
Setting Up Initial Databases,
Installing MariaDB/MySQL system tables in '/config/databases' ...,
> Segmentation fault,
,
Installation of system tables failed! Examine the logs in,
/config/databases for more information.,

,
The problem could be conflicting information in an external,
my.cnf files. You can ignore these by doing:,
,
shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf,
,
You can also try to start the mysqld daemon with:,
,
shell> /usr/sbin/mysqld --skip-grant-tables --general-log &,
,
and use the command line tool /usr/bin/mysql,
to connect to the mysql database and look at the grant tables:,
,
shell> /usr/bin/mysql -u root mysql,
mysql> show tables;,
,
Try 'mysqld --help' if you have problems with paths. Using,
--general-log gives you a log in /config/databases that may be helpful.,
,
The latest information about mysql_install_db is available at,
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db,
You can find the latest source at https://downloads.mariadb.org and,
the maria-discuss email list at https://launchpad.net/~maria-discuss,
,
Please check all of the above before submitting a bug report,
at http://mariadb.org/jira,
,
2021-06-21 14:23:25 3068126416 [Note] mysqld (mysqld 10.1.48-MariaDB-0ubuntu0.18.04.1) starting as process 297 ...,

To Reproduce

  • Create a clean folder in /shares/docker/mariadb
  • Run the image with the following:

docker run -d
--name=mariadb
--security-opt seccomp=unconfined
-e PUID=1000
-e PGID=1000
-e MYSQL_ROOT_PASSWORD=mariadb
-e TZ=Europe/London
-p 3307:3306
-v /shares/docker/mariadb:/config
--restart unless-stopped
linuxserver/mariadb

(--security-opt seccomp=unconfined must be stated here, as a workaround)

Try to connect
root@be552b771326:/config/databases# /usr/bin/mysql -u root mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

General Log
root@be552b771326:/config/databases# mysqld --general-log
2021-06-24 19:41:12 3063375056 [Note] mysqld (mysqld 10.1.48-MariaDB-0ubuntu0.18.04.1) starting as process 536 ...
Segmentation fault

Not starting

Fresh install and it's not running

Ubuntu 18.04.3 LTS

That's the way I start the container:
docker run -d \ --name=mariadb \ --restart=always \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=PASSWORD\ -e TZ=Europe/Berlin \ -v /media/docker/mariadb:/config \ linuxserver/mariadb

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/

GID/UID

User uid: 911
User gid: 911

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2019-08-20 8:09:32 0 [ERROR] mysqld: Can't lock aria control file '/config/databases/aria_log_control' for exclusive use, error: 37. Will retry for 30 seconds
2019-08-20 8:13:15 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/config/databases/aria_log_control'
2019-08-20 8:13:15 0 [ERROR] Plugin 'Aria' init function returned error.
2019-08-20 8:13:15 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2019-08-20 8:13:21 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 37
2019-08-20 8:13:21 0 [ERROR] InnoDB: Operating system error number 37 in a file operation.
2019-08-20 8:13:21 0 [ERROR] InnoDB: Error number 37 means 'No locks available'
2019-08-20 8:13:21 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2019-08-20 8:13:21 0 [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!
2019-08-20 8:13:21 0 [ERROR] InnoDB: Database creation was aborted with error Cannot open a file. You may need to delete the ibdata1 file before trying to start up again.
2019-08-20 8:13:21 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-08-20 8:13:21 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-08-20 8:13:21 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-08-20 8:13:21 0 [ERROR] Aborting

Installation of system tables failed! Examine the logs in
/config/databases for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /usr/sbin/mysqld --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables;

Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /config/databases that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

2019-08-20 8:13:21 0 [Note] mysqld (mysqld 10.3.17-MariaDB-1:10.3.17+maria~bionic-log) starting as process 274 ...
2019-08-20 8:13:28 0 [ERROR] mysqld: Can't lock aria control file '/config/databases/aria_log_control' for exclusive use, error: 37. Will retry for 30 seconds
2019-08-20 8:17:10 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/config/databases/aria_log_control'
2019-08-20 8:17:10 0 [ERROR] Plugin 'Aria' init function returned error.
2019-08-20 8:17:10 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2019-08-20 8:17:10 0 [Note] InnoDB: Using Linux native AIO
2019-08-20 8:17:10 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-08-20 8:17:10 0 [Note] InnoDB: Uses event mutexes
2019-08-20 8:17:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-08-20 8:17:10 0 [Note] InnoDB: Number of pools: 1
2019-08-20 8:17:10 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-08-20 8:17:10 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2019-08-20 8:17:10 0 [Note] InnoDB: Completed initialization of buffer pool
2019-08-20 8:17:10 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-08-20 8:17:16 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 37
2019-08-20 8:17:16 0 [Note] InnoDB: Retrying to lock the first data file
2019-08-20 8:17:23 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 37
2019-08-20 8:17:30 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error:

37

custom sql files on init not working

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Load custom sql files on init

Current Behavior

custom sql files wont load

Steps to Reproduce

  1. docker system prune -a
  2. docker-compose build
  3. docker-compose up -d

DOCKER-COMPOSE.YAML

version: '3'

services:
  mariadb:
    build:
      context: ./db
      dockerfile: mariadb.Dockerfile
    container_name: db-mariadb
    restart: unless-stopped
    ports:
      - "3306:3306"
    environment:
      TZ: Europe/London
      MYSQL_USER: jukebox
      MYSQL_DATABASE: ubox2
      MYSQL_PASSWORD: QoX12mvf
      MYSQL_ROOT_PASSWORD: B9lleTTy
      REMOTE_SQL: http://labs.linkstack.xyz/ubox2.sql
    volumes:
      - ${PWD}
    networks:
      - app-network

DOCKERFILE //I TRIED THIS
# ---- Base Node ----
FROM linuxserver/mariadb

DOCKERFILE //I TRIED THIS ALSO
# ---- Base Node ----
FROM linuxserver/mariadb
COPY ./ubox2.sql /config/initdb.d/ubox2.sql

Environment

**OS:RASPBERRY 3+

Command used to create docker container (run/create/compose/screenshot)

  1. docker system prune -a
  2. docker-compose build
  3. docker-compose up -d

Docker logs

root@DietPi:/home/node_project# docker-compose build
Building mariadb
Step 1/2 : FROM linuxserver/mariadb
latest: Pulling from linuxserver/mariadb
Digest: sha256:95c9ead6d2d0d45db01e0489447e818d05189cd0890576f3999f44727dcf86e1
Status: Downloaded newer image for linuxserver/mariadb:latest
 ---> 9b351c6d2a78
Step 2/2 : COPY ./ubox2.sql /config/initdb.d/ubox2.sql
 ---> a1bf80b0b2d3
Successfully built a1bf80b0b2d3
Successfully tagged node_project_mariadb:latest
root@DietPi:/home/node_project#
root@DietPi:/home/node_project# docker-compose up -d
Creating network "node_project_app-network" with driver "bridge"
Creating volume "node_project_certbot-etc" with default driver
Creating volume "node_project_certbot-var" with default driver
Creating volume "node_project_web-root" with local driver
Creating volume "node_project_node-root" with local driver
Creating db-mariadb ... done
root@DietPi:/home/node_project#
root@DietPi:/home/node_project# docker logs db-mariadb
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2019-10-29  9:40:43 1995569984 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 263 ...
OK
Filling help tables...
2019-10-29  9:41:28 1995406144 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 293 ...
OK
Creating OpenGIS required SP-s...
2019-10-29  9:41:31 1996282688 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 323 ...
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 MariaDB 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 8c5f7ed68b67 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 MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2019-10-29  9:41:35 1995815744 [Note] mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 351 ...
Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
191029 09:41:40 mysqld_safe Logging to syslog.
191029 09:41:41 mysqld_safe Starting mysqld daemon with databases from /config/databases

arch/arm uses outdated version 10.1 of MariaDB

Expected Behavior

When I pull linuxserver/mariadb:latest I would expect version 10.4 to be installed per the release notes.

Current Behavior

linuxserver/mariadb:latest installs version 10.1.

mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Steps to Reproduce

  1. run any docker-compose with linuxserver/mariadb:latest

Environment

OS: OMV5 / Debian Buster
CPU architecture: arm32
How docker service was installed:
Using OMV5's built-in installer

Command used to create docker container (run/create/compose/screenshot)

version: "3"

services:
  db:
    image: linuxserver/mariadb:latest
    network_mode: bridge
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=100
      - MYSQL_ROOT_PASSWORD=1234
      - TZ=America/Santiago
      - MYSQL_DATABASE=somename
      - MYSQL_USER=somename
      - MYSQL_PASSWORD=abcd 
    volumes:
      - db_data:/config
    ports:
      - 3306:3306
    restart: unless-stopped

Upating the image, results in a boot loop, failing to boot.

After updating the image, I get this when start it up, it continues to loop over and over.

`
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes


      _         ()


     | |  ___   _    __


     | | / __| | |  /  \ 


     | | \__ \ | | | () |


     |_| |___/ |_|  \__/

Brought to you by linuxserver.io


To support LSIO projects visit:

https://www.linuxserver.io/donate/


GID/UID


User uid: 1000

User gid: 1000


[cont-init.d] 10-adduser: exited 0.

[cont-init.d] 30-config: executing...

[cont-init.d] 30-config: exited 0.

[cont-init.d] 40-initialise-db: executing...

[cont-init.d] 40-initialise-db: exited 0.

[cont-init.d] 90-warning: executing...



  •                                                *
    
  •                                                *
    
  •      This image will soon be rebased           *
    
  •           from ubuntu to alpine.               *
    
  •   Please be aware, this may cause issues       *
    
  • It is strongly recommended to make backups     *
    
  •     of your config and databases before        *
    
  •   updating your image to the alpine base.      *
    
  •                                                *
    
  •                                                *
    


[cont-init.d] 90-warning: exited 0.

[cont-init.d] 99-custom-scripts: executing...

[custom-init] no custom files found exiting...

[cont-init.d] 99-custom-scripts: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

210603 16:16:40 mysqld_safe Logging to syslog.

210603 16:16:40 mysqld_safe Starting mysqld daemon with databases from /config/databases

210603 16:16:41 mysqld_safe Logging to syslog.

210603 16:16:41 mysqld_safe Starting mysqld daemon with databases from /config/databases

210603 16:16:43 mysqld_safe Logging to syslog.

210603 16:16:43 mysqld_safe Starting mysqld daemon with databases from /config/databases

210603 16:16:44 mysqld_safe Logging to syslog.

210603 16:16:44 mysqld_safe Starting mysqld daemon with databases from /config/databases
`

Container on armhf won't start (loop) with data processed with amd64 container

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.

I run a cluster with a mixed of amd64 and armhf nodes.
I noticed that once the databases have been processed on a amd64 node, it won't be possible to run them on a armhf node.
I noticed also that the problem is solved if I remove the files : ib_logfile0 ib_logfile1 ibdata1

Expected Behavior

I would expect that container could be launched on armhf architecture, even if the databases have been used on amd64 architecture.

Current Behavior

Once the databases have been processed on a amd64 node, it won't be possible to run them on a armhf node.
The container can be started on arm again if the files ib_logfile0, ib_logfile1, ibdata1 are deleted.

Steps to Reproduce

  1. launch a container on armhf. Wait for proper initialization. Shutdown the container
  2. launch a container on amd64 with same /config volume. Wait for start up. Shutdown the container
  3. relaunch the container on armhf. The container won't properly start anymore (loop):
    mariadb | 191231 10:19:18 mysqld_safe Logging to syslog.
    mariadb | 191231 10:19:18 mysqld_safe Starting mysqld daemon with databases from /config/databases

Environment

x86_64 node:
Container Linux by CoreOS stable (2303.3.0)
Docker 18.06.3-ce

arm32 node:
HypriotOS/armv7
Docker 18.06.1-ce

Command used to create docker container (run/create/compose/screenshot)

version: "2"
services:
mariadb:
image: linuxserver/mariadb
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=xxxx
- TZ=Europe/London
- MYSQL_DATABASE=xxxx
- MYSQL_USER=xxxx
- MYSQL_PASSWORD=xxxx
volumes:
- /mnt/pv/test/config:/config
ports:
- 3306:3306
restart: unless-stopped

Docker logs

mariadb | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
mariadb | [s6-init] ensuring user provided files have correct perms...exited 0.
mariadb | [fix-attrs.d] applying ownership & permissions fixes...
mariadb | [fix-attrs.d] done.
mariadb | [cont-init.d] executing container initialization scripts...
mariadb | [cont-init.d] 01-envfile: executing...
mariadb | [cont-init.d] 01-envfile: exited 0.
mariadb | [cont-init.d] 10-adduser: executing...
mariadb |
mariadb | -------------------------------------
mariadb | _ ()
mariadb | | | ___ _ __
mariadb | | | / | | | /
mariadb | | | _
\ | | | () |
mariadb | || |
/ || __/
mariadb |
mariadb |
mariadb | Brought to you by linuxserver.io
mariadb | We gratefully accept donations at:
mariadb | https://www.linuxserver.io/donate/
mariadb | -------------------------------------
mariadb | GID/UID
mariadb | -------------------------------------
mariadb |
mariadb | User uid: 1000
mariadb | User gid: 1000
mariadb | -------------------------------------
mariadb |
mariadb | [cont-init.d] 10-adduser: exited 0.
mariadb | [cont-init.d] 30-config: executing...
mariadb | [cont-init.d] 30-config: exited 0.
mariadb | [cont-init.d] 40-initialise-db: executing...
mariadb | [cont-init.d] 40-initialise-db: exited 0.
mariadb | [cont-init.d] 99-custom-scripts: executing...
mariadb | [custom-init] no custom files found exiting...
mariadb | [cont-init.d] 99-custom-scripts: exited 0.
mariadb | [cont-init.d] done.
mariadb | [services.d] starting services
mariadb | [services.d] done.
mariadb | 191231 10:16:47 mysqld_safe Logging to syslog.
mariadb | 191231 10:16:47 mysqld_safe Starting mysqld daemon with databases from /config/databases
mariadb | 191231 10:16:49 mysqld_safe Logging to syslog.
mariadb | 191231 10:16:50 mysqld_safe Starting mysqld daemon with dat

Starting container with empty /config directory does not create required mariadb.sys@localhost user

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

When I start the container using an empty /config directory, it creates a fresh mysql database. This database contains the user tables and view of MariaDB.
I expect the user table to contain the default user mariadb.sys@localhost.

Current Behavior

The user tables and view do not contain the user mariadb.sys@localhost. This causes MariaDB to throw errors when trying to manage users.

Steps to Reproduce

Because I am no hero using the MariaDB CLI, these steps and the following docker-compose.yml also contain phpmyadmin.

  1. Make sure the directory ./mariadb/config is empty, so a new database has to be created.
  2. Run sudo docker-compose up -d using the docker-compose.yml in this ticket.
  3. Go to http://<hostip>:8070/
  4. Log in using username: root and password: supersecretpass
  5. Click on 'User accounts' in the top navbar.
    image
  6. Get error "Not enough privilege to view users."
  7. Click in the left sidebar to mysql > Views > user.
    image
  8. Get error "#1449 - The user specified as a definer ('mariadb.sys'@'localhost') does not exist"

Additional information

Views in MariaDB have a DEFINER user. This user must exist to allow the view to execute. The definer for system view mysql.user is mariadb.sys@localhost.

If I execute the query that the view normally would execute, I can see there is only one user: root@%.

select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv`

image

As a test I have also created a container using the official mariadb image.
When I inspect the user table on this fresh database, I can see it does contain mariadb.sys@localhost.
image

Environment

OS: Ubuntu Server 20.04 LTS
CPU architecture: x86_64
How docker service was installed:
Using APT, following the official guide on the Docker website

Command used to create docker container (run/create/compose/screenshot)

version: "3.8"
services:
  mariadb:
    container_name: mariadb
    image: linuxserver/mariadb
    hostname: mariadb
    restart: unless-stopped
    volumes:
      - ./mariadb/config:/config
    environment:
      - MYSQL_ROOT_PASSWORD=supersecretpass
      - PUID=${PUID_MARIADB}
      - PGID
      - TZ

  phpmyadmin:
    container_name: phpmyadmin
    image: phpmyadmin/phpmyadmin
    restart: unless-stopped
    init: true
    depends_on:
      - mariadb
    ports:
      - 8070:80
    environment:
      - MYSQL_ROOT_PASSWORD=supersecretpass
      - PMA_HOST=mariadb

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[env-init] MYSQL_ROOT_PASSWORD set from FILE__MYSQL_ROOT_PASSWORD
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    117
User gid:    118
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing... 
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
OK

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


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is abc@localhost, it has no password either, but
you need to be the system 'abc' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
200522 14:09:14 mysqld_safe Logging to syslog.
200522 14:09:15 mysqld_safe Starting mysqld daemon with databases from /config/databases

alpine does not initialize with the correct date resulting in an error

linuxserver.io


Expected Behavior

I would expect it to initialize correctly.

Current Behavior

It initializes fine when I create a container using the latest tag. I'm using this container as a db for nextcloud which complains about using an older version. Therefore I tried to switch to the alpine tag and got the error.
It fails with the error 286213-04-14 10:25:39 0 [ERROR] This MySQL server doesn't support dates later than 2038 during startup

Steps to Reproduce

  1. initialize using the image linuxserver/mariadb:alpine

Environment

OS: Raspbian buster (Debian 10.8) with Linux kernel 5.10.11-v7l+
CPU architecture: arm32 (raspberry pi 4)
How docker service was installed: Create a stack using portainer with a docker-compose yaml script

Command used to create docker container (run/create/compose/screenshot)

I create a new portainer stack using this docker-compose yaml script:

version: '2'

volumes:
nextcloud:
db:

services:
db:
image: ghcr.io/linuxserver/mariadb:alpine
restart: always
volumes:
- /opt/appdata/mariadb:/config
environment:
- MYSQL_ROOT_PASSWORD=root_pass
- MYSQL_PASSWORD=db_pass
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- PGID=1001
- PUID=1001
- TZ=America/Chicago

app:
image: nextcloud
restart: always
ports:
- 18080:80
links:
- db
volumes:
- /mnt/easystore/nextcloud:/var/www/html/data
- /opt/appdata/nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=db_pass
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db:3306
- PGID=1001
- PUID=1001
- TZ=America/Chicago

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 01-envfile: executing... ,
[cont-init.d] 01-envfile: exited 0.,
[cont-init.d] 10-adduser: executing... ,
,
-------------------------------------,
_ (),
| | ___ _ _,
| | / | | | / \ ,
| | _
\ | | | () |,
|| |
/ || _/,
,
,
Brought to you by linuxserver.io,
-------------------------------------,
,
To support LSIO projects visit:,
https://www.linuxserver.io/donate/,
-------------------------------------,
GID/UID,
-------------------------------------,
,
User uid: 1001,
User gid: 1001,
-------------------------------------,
,
[cont-init.d] 10-adduser: exited 0.,
[cont-init.d] 30-config: executing... ,
[cont-init.d] 30-config: exited 0.,
[cont-init.d] 40-initialise-db: executing... ,
Setting Up Initial Databases,
Installing MariaDB/MySQL system tables in '/config/databases' ...,
286213-04-14 10:25:39 0 [ERROR] This MySQL server doesn't support dates later than 2038,
,
Installation of system tables failed! Examine the logs in,
/config/databases for more information.,
,
The problem could be conflicting information in an external,
my.cnf files. You can ignore these by doing:,
,
shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf,
,
You can also try to start the mysqld daemon with:,
,
shell> /usr/bin/mysqld --skip-grant-tables --general-log &,
,
and use the command line tool /usr/bin/mysql,
to connect to the mysql database and look at the grant tables:,
,
shell> /usr/bin/mysql -u root mysql,
mysql> show tables;,
,
Try 'mysqld --help' if you have problems with paths. Using,
--general-log gives you a log in /config/databases that may be helpful.,
,
The latest information about mysql_install_db is available at,
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db,
You can find the latest source at https://downloads.mariadb.org and,
the maria-discuss email list at https://launchpad.net/~maria-discuss,
,
Please check all of the above before submitting a bug report,
at https://mariadb.org/jira,
,
437489-07-07 13:35:04 0 [ERROR] This MySQL server doesn't support dates later than 2038,

I can see that the date is set incorrectly in the container:

Wed Dec 31 18:00:00 CST 1969

Client connect docker mariadb response slow

linuxserver.io

Reporting Bug:
Mariadb response very slow on docker


Expected Behavior

When run mariadb in docker, other clients (also run in docker) connect to mariadb should be fast and smoothe.

Current Behavior

When clients connect to docker-mariadb, the maraidb response a very slow speed.

Steps to Reproduce

  1. pull and run mariadb
  2. pull and run 3rd client like phpmyadmin, piwigo and etc
  3. configure client to connect to docker-mariadb
  4. docker-mariadb response very very slowly almost cost about 12s.
  5. If you deploy a maraidb on a server directly, it response client very fast.

Environment

OS: Unraid
CPU architecture: x86_64
How docker service was installed:

Command used to create docker container (run/create/compose/screenshot)

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='mariadb' --net='my-bridge' --ip='172.18.0.10' -e TZ="Asia/Shanghai" -e HOST_OS="Unraid" -e 'PUID'='99' -e 'PGID'='100' -e 'MYSQL_ROOT_PASSWORD'='***' -p '3307:3306/tcp' -v '/mnt/user/appdata/mariadb':'/config':'rw' 'linuxserver/mariadb'

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...


_ ()
| | ___ _ __
| | / | | | /
| | _
\ | | | () |
|| |
/ || __/

Brought to you by linuxserver.io

To support LSIO projects visit:
https://www.linuxserver.io/donate/

GID/UID

User uid: 99
User gid: 100

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2020-07-19 13:13:30 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")

OK

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

Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is abc@localhost, it has no password either, but
you need to be the system 'abc' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2020-07-19 13:13:32 0 [Note] mysqld (mysqld 10.4.13-MariaDB-1:10.4.13+mariabionic-log) starting as process 324 ...
2020-07-19 13:13:32 0 [Note] InnoDB: Using Linux native AIO
2020-07-19 13:13:32 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-19 13:13:32 0 [Note] InnoDB: Uses event mutexes
2020-07-19 13:13:32 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-19 13:13:32 0 [Note] InnoDB: Number of pools: 1
2020-07-19 13:13:32 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-07-19 13:13:32 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-07-19 13:13:32 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-07-19 13:13:32 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-19 13:13:32 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-19 13:13:32 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-07-19 13:13:32 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-19 13:13:32 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-07-19 13:13:32 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-07-19 13:13:32 0 [Note] InnoDB: Waiting for purge to start
2020-07-19 13:13:32 0 [Note] InnoDB: 10.4.13 started; log sequence number 60972; transaction id 21
2020-07-19 13:13:32 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-19 13:13:32 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2020-07-19 13:13:32 0 [Note] InnoDB: Buffer pool(s) load completed at 200719 13:13:32
2020-07-19 13:13:32 0 [Note] Server socket created on IP: '::'.
2020-07-19 13:13:32 0 [Note] Reading of all Master_info entries succeeded
2020-07-19 13:13:32 0 [Note] Added new Master_info '' to hash table
2020-07-19 13:13:32 0 [Note] mysqld: ready for connections.
Version: '10.4.13-MariaDB-1:10.4.13+maria
bionic-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution

2020-07-19 13:13:34 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2020-07-19 13:13:34 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-07-19 13:13:34 0 [Note] InnoDB: FTS optimize thread exiting.
2020-07-19 13:13:34 0 [Note] InnoDB: Starting shutdown...
2020-07-19 13:13:34 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
2020-07-19 13:13:34 0 [Note] InnoDB: Buffer pool(s) dump completed at 200719 13:13:34
2020-07-19 13:13:35 0 [Note] InnoDB: Shutdown completed; log sequence number 60981; transaction id 24
2020-07-19 13:13:35 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-07-19 13:13:35 0 [Note] mysqld: Shutdown complete

Database Setup Completed
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
200719 13:13:36 mysqld_safe Logging to syslog.
200719 13:13:36 mysqld_safe Starting mysqld daemon with databases from /config/databases

Armhf image has outdated MariaDB version: 10.1.47

If I understand correctly, changelog says that MariaDB version should be 10.4, but instead is 10.1.47. I did docker-compose pull and image seems to be up to date, but MariaDB version is still outdated.

Environment

OS: Raspbian Buster
CPU architecture: arm32
How docker service was installed:

version: "2.1"
services:
  mariadb:
    image: ghcr.io/linuxserver/mariadb
    container_name: mariadb
    environment:
      - PUID=1001
      - PGID=1001
      - MYSQL_ROOT_PASSWORD=****
      - TZ=Europe/Warsaw
      - MYSQL_USER=****
      - MYSQL_PASSWORD=****
    volumes:
      - /mnt/storage/mariadb:/config
    ports:
      - 3306:3306
    networks:
      - shared
    restart: unless-stopped
networks:
  shared:
    driver: bridge

Command used to create docker container (run/create/compose/screenshot)

docker-compose up -d

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1001
User gid:    1001
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 40-initialise-db: executing...
[cont-init.d] 40-initialise-db: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
210122 20:27:00 mysqld_safe Logging to syslog.
210122 20:27:00 mysqld_safe Starting mysqld daemon with databases from /config/databases

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.