Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.7.1
-
None
-
None
-
ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))
Description
Description
When we start the mariadb docker with `--skip-grant-tables` option, the docker exited 1 and failed due to the following error
--------------
DROP USER IF EXISTS root@'127.0.0.1', root@'::1'
--------------ERROR 1290 (HY000) at line 7: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
This issue can also be reproduced with skip_grant_tables=ON in the mariadb configuration file.
This issue is caused by the conflict between the DROP USER IF EXISTS root@'127.0.0.1', root@'::1' from the MariaDB's docker entrypoint script at [here](https://github.com/MariaDB/mariadb-docker/blob/master/11.7/docker-entrypoint.sh#L489) and the `--skip-grant-tables` option.
How to repeat
Pull the latest docker image of mariadb:
docker pull mariadb:latest
Start MariaDB Docker with `--skip-grant-tables` option:
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb:latest --skip_grant_tables
Check the status of mariadb docker and see the status of it to be `Exited (1)`:
docker ps -a
Check the logs of mariadb docker instance:
docker logs mariadbtest
which outputs the following log:
--------------
DROP USER IF EXISTS root@'127.0.0.1', root@'::1'
--------------ERROR 1290 (HY000) at line 7: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
The root cause is that during the initialization of the MariaDB Docker container, the `docker-entrypoint.sh` script runs the query `DROP USER IF EXISTS root@'127.0.0.1', root@'::1'`. However, this query fails to execute when `--skip-grant-tables` is enabled. As a result, the entrypoint script of MariaDB container exits with error 1 and the MariaDB container crashes.
Suggested fix
The fix of this issue is to find an alternative way to run the [DROP command](https://github.com/MariaDB/mariadb-docker/blob/master/11.7/docker-entrypoint.sh#L489) when `--skip-grant-tables` option is used.
Attachments
Issue Links
- relates to
-
MDEV-27435 Support extra initialization file for mysql_install_db
- Closed
-
MDEV-35668 --bootstrap user don't have proxy privs so cannot grant it
- Open