MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
770 stars 438 forks source link

Restore Root Password on running container #385

Closed invertium closed 3 years ago

invertium commented 3 years ago

I have a running mariadb container that I was using with partdb (https://github.com/Part-DB/Part-DB)

Now somebody accidentally reset the database password on the partsdb server. Sadly I don't know where the compose file was executed from. I don't have access to that database anymore :) I could run the bash and run:

echo $MYSQL_ROOT_PASSWORD

That actually gives me a password but then running mysql -uroot -p and entering the password gives me a permission denied. Since I cannot run the docker compose container again I can also not try this: https://wolfgang.gassler.org/reset-password-mariadb-mysql-docker/

I've been trying to restore the data from within the docker container but no luck so far. I Wasn't able to stop the mysqld process in the container to restart it with the --skip-grant-tables command.

I also tried to copy the /var/lib/mysql file to a different location and starting a new server over it but no luck.

Any ideas on how to access the mysqld process or get the right password from within the container?

grooverdan commented 3 years ago

there's a mechanism in #362, it does require a restart however.

grooverdan commented 3 years ago

Please tell me if anything in the front page FAQ is unclear or doesn't work correctly.