8

My journey into learning Docker, chapter {chapter++}:

Today I learned that when you use a database image in your docker-compose file, and you want to rebuild the whole thing for reasons (say, a big update), then if you change your credentials ("root" to "a_lambda_user" or change the db's password) for more security, and you rebuild and up the whole thing... It won't work. You'll get "access denied".

Because the database (at least mysql and mariadb) will persist somewhere, so you need to run "docker rm -v" even though you didn't use any volumes.

I love loosing my fucking time.

Comments
  • 0
    Did you know Docker was made in Go?
  • 1
    @TwiN yup, I have a GoLang groupie colleague where I work, he told me that at the very beginning of when I started learning Docker
  • 0
    Not always ma man.
    If your docker compose defines a volume or maps SQL database folder from the container to your host then yes you will face that error because your compose file is still using same volume/mapped folder

    You have 1 option to prevent data loss:
    Manually connect to your sqlite database alter your admin user to use the password you want, then run your updated compose file.

    worst case scenario if you don't have sqlite tools on server get a copy of database do it locally then put it back on the server
  • 0
    You are using volumes, you just don't name them.
Add Comment