I cannot connect to my MySQL Database, can someone help?

I’m going to preface this with saying that I am new to using devilbox and docker, I am also not great at knowing how to provide all the correct things like error logs or anything like that because I don’t know where to get them…

But I am consistently getting the error "access denied for user ‘root’@‘172.16.238.1’ when I try to connect to my database. I have connected to my database before and it worked just fine but recently it stopped letting me connect and I’ve tried restarting docker many times and that doesn’t help.

I went into my .env file and decided to try updating my MySQL server image from MYSQL_SERVER=mariadb-10.4 to MYSQL_SERVER=mariadb-10.6 and it did fix the error and allowed me to log into my database but all my databases were missing because they were created on the older version of MySQL. so I went back to 10.4 and tried to do a mysqldump-secure but get these errors:

is there anyone that can help me figure out how to get to my database? I’ve been googling for so many hours and I cannot figure it out…

if you need some logs or anything please just tell me where/how I can get them and I’ll leave them in a comment.

Thanks so much in advance.

Have you edited the file at /etc/mysqldump-secure.cnf?
You must have modified the password for root user on mysql somehow?

Are you able to access the mysql tools in the devilbox dashboard? (go to http://localhost ) and look for phpmyadmin)?

@jamieswebdesign11, it’s hard to reply without any information about the content of your .env file.
I suggest to follow these steps:

  1. enable the old MySQL version into the devilbox/.env file:
    #MYSQL_SERVER=mariadb-10.3
    MYSQL_SERVER=mariadb-10.4
    #MYSQL_SERVER=mariadb-10.5
    #MYSQL_SERVER=mariadb-10.6
    #MYSQL_SERVER=mariadb-10.7
    
  2. stop and restart Devilbox:
    cd path/to/devilbox
    docker-compose down && docker-compose up -d mysql
    
  3. using your favorite MySQL client (MySQL Workbench, DBeaver, HeidiSQL, etc.) make a dump of your database WHITHOUT create schema option (only structure and data).
  4. change the DB version into devilbox/.env file:
    #MYSQL_SERVER=mariadb-10.3
    # MYSQL_SERVER=mariadb-10.4
    #MYSQL_SERVER=mariadb-10.5
    MYSQL_SERVER=mariadb-10.6
    #MYSQL_SERVER=mariadb-10.7
    
  5. Stop and restart Devilbox:
    cd path/to/devilbox
    docker-compose down && docker-compose up -d mysql
    
  6. using the same MySQL client:
    • create a new schema
    • select it as default
    • import the dump you made above.