Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mariadb unable to grant all privileges after upgrade #68002

Closed
hexclann opened this issue Jun 21, 2024 · 2 comments
Closed

Mariadb unable to grant all privileges after upgrade #68002

hexclann opened this issue Jun 21, 2024 · 2 comments
Assignees
Labels
mariadb solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@hexclann
Copy link

hexclann commented Jun 21, 2024

Name and Version

bitnami/mariadb:latest

What architecture are you using?

arm64

What steps will reproduce the bug?

I'm using the following version:

"OS_ARCH=arm64",
"OS_FLAVOUR=debian-12",
"OS_NAME=linux",
"APP_VERSION=11.3.2",
"BITNAMI_APP_NAME=mariadb"
"Image": "bitnami/mariadb:latest"

Steps I did:

  1. My database was created using:
docker run --restart always --name mariadb --network mynetwork --ip 10.69.0.5 -p 127.0.0.1:30000:3306 -e MARIADB_ROOT_USER=root -e MARIADB_ROOT_PASSWORD=myrootpass -v /opt/dbvolume:/bitnami/mariadb -d bitnami/mariadb:latest
  1. It is an old mariadb docker container where I took a backup of my entire db using the command mariadb-dump -uroot -pmyrootpass --all-databases > /bitnami/mariadb/data/mydbbackup.sql.
  2. I upgraded the mariadb by removing the old container and deploying a new container with the latest image mentioned above. I used the same root password and other parameters mentioned in the first point.
  3. I restored the old backup using the command `mariadb -u root -pmyrootpass < "/tmp/mydbbackup.sql". All my services relying on db came online and working fine.
  4. However when I create a new database I get the following error:
create database testdb;
CREATE USER 'testuser'@'%' IDENTIFIED BY 'testpass';
GRANT ALL ON testdb.* TO 'testuser'@'%';
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'testdb'

I checked the root user grant permission:

Screenshot 2024-06-21 at 3 27 41 PM Screenshot 2024-06-21 at 3 28 12 PM

I'm using the mysql_native_password plugin:

Screenshot 2024-06-21 at 3 29 12 PM

What is the expected behavior?

GRANT ALL ON testdb.* TO 'testuser'@'%';

should grant permission.

What do you see instead?

ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'testdb'

Additional information

I created a new container and ran SHOW GRANTS FOR 'root'@'%';. The output is:

Screenshot 2024-06-21 at 3 43 25 PM

which is different than the other problematic containers:

Screenshot 2024-06-21 at 3 28 12 PM
@hexclann hexclann added the tech-issues The user has a technical issue about an application label Jun 21, 2024
@github-actions github-actions bot added the triage Triage is needed label Jun 21, 2024
@carrodher
Copy link
Member

The issue may not be directly related to the Bitnami container image/Helm chart, but rather to how the application is being utilized, configured in your specific environment, or tied to a specific scenario that is not easy to reproduce on our side.

If you think that's not the case and are interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

Suppose you have any questions about the application, customizing its content, or technology and infrastructure usage. In that case, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

@hexclann
Copy link
Author

@carrodher understood.

I had multiple wordpress sites. I fixed the issue by taking individual DB backup of each site using wp-cli and removing the old container including its volume. And I created a new container and created all the previous users and databases, restored wordpress site database using wp-cli.

If there is any better way to handle database upgrades in docker environment, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mariadb solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants