0

I have a MariaDB up and running inside a docker container, and I can connect to it using adminer. I have more than 10 databases in it. I can access all data from adminer.

In my code I'm using EF Core MariaDB provider and I still have access to some of the databases.

All of my connection strings use the same user (root) and the same password.

The all inherit from the same DatabaseContext. But for some databases, I receive this error:

Access denied for user 'root'@'192.168.80.4' (using password: YES)

What could be the reason?

Please note that a lot of questions on this site are not addressing this issue. They either have access, or they don't have access at all. Or they have not set the password for the root user.

This is the result of SELECT user, password FROM mysql.user:

User,Password
mariadb.sys,""
root,*5D7D1AA0BB8037E0CF0080B8A6B2DF7D189EBD7B
root,*5D7D1AA0BB8037E0CF0080B8A6B2DF7D189EBD7B

I don't know why do I have two root users.

This is the result of show grants:

GRANT ALL PRIVILEGES ON . TO root@% IDENTIFIED BY PASSWORD '*5D7D1AA0BB8037E0CF0080B8A6B2DF7D189EBD7B' WITH GRANT OPTION
8
  • Execute SHOW GRANTS and check does your account have enough privileges.
    – Akina
    Commented Dec 29, 2021 at 11:19
  • @Akina, my user is root. Can root user lack privileges? I have not chaneged anything. Commented Dec 29, 2021 at 12:04
  • Have you checked already? have you ensured that current user have needed privileges?
    – Akina
    Commented Dec 29, 2021 at 12:06
  • This is the result of show grants: GRANT ALL PRIVILEGES ON . TO root@% IDENTIFIED BY PASSWORD '*5D7D1AA0BB8037E0CF0080B8A6B2DF7D189EBD7B' WITH GRANT OPTION Commented Dec 29, 2021 at 12:15
  • The grants for root don't look right. Mine shows GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY PASSWORD .... the *.* is for all databases. Your seems to show for none.
    – Dave
    Commented Dec 29, 2021 at 17:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.