docker-library / docker-library/mysql

Plugin load failed in mysql container

Open
#977 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
2.6k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

How to reproduce:

docker run -d --name=my-mysql --env="MYSQL_ROOT_PASSWORD=123456" --publish 13306:3306 --volume=./mysql/my.cnf:/etc/my.cnf mysql/mysql-server:8.0.32

my.cnf:

[mysqld]
skip-host-cache
skip-name-resolve
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
secure-file-priv=/var/lib/mysql-files
user=mysql
pid-file=/var/run/mysqld/mysqld.pid

plugin-load=validate_password.so
validate-password=FORCE_PLUS_PERMANENT
validate_password_length=14
validate_password_mixed_case_count=1
validate_password_number_count=1
validate_password_special_char_count=1
validate_password_policy=MEDIUM

I want to load plugin validate_password.so. But when I run this container, an error is thrown.

[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
[Entrypoint] Initializing database
2023-06-26T06:32:06.714619Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-06-26T06:32:06.714784Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32) initializing of server in progress as process 17
2023-06-26T06:32:06.723393Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-26T06:32:07.160560Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-06-26T06:32:07.632283Z 0 [Warning] [MY-013501] [Server] Ignoring --plugin-load[_add] list as the server is running with --initialize(-insecure).
2023-06-26T06:32:08.786765Z 0 [ERROR] [MY-000067] [Server] unknown variable 'validate-password=FORCE_PLUS_PERMANENT'.
2023-06-26T06:32:08.786799Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2023-06-26T06:32:08.786805Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-06-26T06:32:11.167569Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32)  MySQL Community Server - GPL.

I think this error is caused by this line https://github.com/docker-library/mysql/blob/master/8.0/docker-entrypoint.sh#L238C1-L238C1, container use mysql use option "-initialize-insecure" to initialize datadir. Option "-initialize-insecure" will ignore plugin-load, causing the option "validate-password" not recognized.

My question is how to load plugin in mysql container? Is it designed to have no capability to load plugin ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction command and my.cnf, then inspect 8.0/docker-entrypoint.sh around line 238 and the initialization output showing plugin-load is ignored. Determine whether the image supports loading validate_password during initialization and document or verify the supported configuration path. Done means the container initializes successfully with the intended plugin settings, or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, mysql
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.