MariaDB + PHPMyAdmin


Recommended Posts

Hi all - I'm hoping someone can help me with this as I've been chewing on it for about a week now!


I'm trying to get a database server running with PHPMyAdmin as the interface for admin.....I've got MariaDB up and running, and that's working with my Kodi Database.  I've got the PHPMYAdmin Docker running from https://hub.docker.com/r/phpmyadmin/phpmyadmin/, and I can get to the login screen for PHPMyAdmin.

 

I think I understand from the Guide that I need to create a link container, which I asssume links the MariaDB Docker to the PHPMyAdmin Docker, but this is where I'm stuck.  I'm running the command as shown in the Guide, modifying it to...

 

docker run --name myadmin -d --link mariadb:db -p 8181:81 phpmyadmin/phpmyadmin

 

...Where MariaDB is the name of the Maria docker, and I've changed the port numbers to 8181 and 81 as the main UnRaid GUI runs on 80 so it was clashing.

 

And this is where I get stuck....when trying to log in to PHPMyAdmin, I get the error "mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: Name does not resolve".

 

Does anyone have this setup running on their system who can help me with this?  I'm a noob when it comes to Docker and my knowledge is limited, but I'm learning more and more each day.  I really need PHPMyAdmin so I can administrate databases for my Apache server....I know I could do it CLI, but I'd much rather be able to see the database via a nice GUI.

 

I'm probably missing something really simple!

 

Thanks in advance!

 

  • Upvote 1
Link to comment
  • 1 year later...
  • 1 year later...
  • 1 year later...

I am also having this same issue, and have not found a published solution or thread that discusses this.

 

Initially, I deployed the 2 containers on the default "bridge" network. Connectivity from the PHPMyAdmin container can only use IP addresses here, which causes me a problem with hard-coding. My intention is to have a SINGLE mariadb container, servicing the back-end needs for many other app-based containers. However, in the PHPMyAdmin's config, under "MYSQL_HOST", if I put in `mariadb` it cannot connect. If I put in the assigned MariaDB container's IP, it works.

 

Docker documentation, at this time of writing, states "--link" is deprecated and to use networking configuration to allow this. Using user-defined networks allows name-based resolution as well as IP addresses. This sounds ideal for me!

 

At the main "tower.local" console (from the GUI's top-right options), I issued:

 

docker network create main-net

 

I re-created the MariaDB-Official and PHPMyAdmin containers, both connected to this new `main-net` network.

 

In the PHPMySQLAdmin, I was still specifying "mariadb" (the name of the mariadb container) under the `MYSQL_HOST` field. When I try to connect, it still errors. But if look in the MySQL's log file, I see:

 

Quote

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

 

Which suggests the correct container (mariadb) IS being hit with the PHPMyAdmin login request. The PHPMyAdmin is specifying the "@'172.18.0.3'" as part of the connection string.

 

To test this, I redeployed the PHPMyAdmin container, hard-coding the `mariadb` container's IP address (172.18.0.2). Now it logs in fine! But I have hard-coded.

 

If I go to the `mariadb` User Accounts section, these are the default users in my setup:

SCR-20230201-e43.thumb.png.8fea5839ddcd12d2952a74a3f99fd106.png

 

I created a NEW user, with a specific "Host name" entry of the PHPMyAdmin container, 172.18.0.3 (to mimic the log file entry I saw).

SCR-20230201-iee.thumb.png.82bbc4154176ed7fee77b4b1f11c6488.png

 

Then I redeploy the PHPMyAdmin container to use the `mariadb` as the MYSQL_HOST entry. Retrying the PHPMyAdmin login, which is now successful.

 

Why is the 'root'@'%' not being applied to my authentication, to cover the scenario of `'root'@'172.18.0.3'`?

I thought this was the point of the "%" (basically saying ANY host) configuration?

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.