pierrecdn / phpipam

phpIPAM Docker image
GNU Lesser General Public License v3.0
94 stars 111 forks source link

Cannot connect to database after initial injection #36

Closed ybizeul closed 5 years ago

ybizeul commented 6 years ago

Regarding issue : https://github.com/phpipam/phpipam/issues/2290

Unless specified otherwise, phpipam injects a standard user/password for later database access once the initial injection is done.

This results in impossibility to connect as the default host for the connection is localhost, which prevents phpipam container to connect to the database.

pierrecdn commented 5 years ago

Hi, Maybe I didn't understand your issue, so feel free to correct me.

First, localhost is changed to mysql by default, so that people can freely link their containers using --link my-specific-name:mysql Someone also introduced the ability to customize the mysql host.

So in the container setup, accesses are always seen as "remote".

Does it anwser your concerns?

ybizeul commented 5 years ago

I should have done a better job documenting this... I can't remember now what went wrong now. I guess we can close this.

Thanks for answering, I'll comment next time I install it.

ybizeul commented 5 years ago

Just talked to a friend, he had the same issue, he reminded me : The problem was on the DB side, things were fine on the php config files, but privileges in the DB (injected my the initial setup of the DB by php) specifies credentials user@localhost in the GRANT statement. After that, MySQL rejects connections from the phpipam container, you have to manually GRANT user@%

pierrecdn commented 5 years ago

If you follow the README instructions you shouldn't have these grant issues. I guess the DB setup was somehow specific?

pierrecdn commented 5 years ago

Is it still the case if you pull latest? I just commited https://github.com/pierrecdn/phpipam/commit/cb4ec5baf6e9022f50d7027bc52f55f8788d631e, it should fix common installations. Feel free to reopen if still broken.

ybizeul commented 5 years ago

Thanks Pierre, I'll check and report here if needed!