When I try to login to either phpMyAdmin or using PHP, I get an error saying: Host ‘172.25.0.2’ is not allowed to connect to this MariaDB server in /var/www/html/index.php
I have tried numerous things, but this error keeps coming. What I want is to allow both php-custom and phpmyadmin to be able to connect to db. I have also tried MySQL, but can’t seem to get this running where MariaDB was up in minutes.
What am I overlooking here? I’m running Docker (or Container Manager) on Synology BTW.
I added the following environment variables, waited a long, long, long time and now all of a sudden I’m able to login as root… I’m going crazy. Delete the user “user”, but I’m assuming it will return on my next rebuild. Strange.
MYSQL_DATABASE: mydatabase
MYSQL_USER: user
MYSQL_PASSWORD: password
Guess it’s even more strange to have your root pass in a yml file?
It doesn’t have to be in the yaml file, you can save it in a .env file and pass it like:
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
And that password is required only when you first start the server. You can remove the variable later. After recreating (docker compose down and docker compose up again) the container the environment variable willl disappear also from the container.
Yes maybe, but that’s all the same to me. And what if I need to recreate the container, I still need to insert it. But then again, it’s probably the same as having the password in my PHP code for connecting.
I’ll have a look at MARIADB_PASSWORD_HASH then at least it’s hashed. But can’t directly find a lot of info on the subject.
Funny thing: I just rebuilt everything without the extra environment variables and now I’m able to login. But if I have to wait this long every time I have to rebuild… dang.