One of the initial posts for creating a local development environment on macOS included a section for installing PHPMyAdmin.
But sometimes I like to fall back on a handful of browser tools. Call me old school, but I find them easier to do simple tasks like navigate a database or run a quick query.
So if you're like me, you may still want a copy of PHPMyAdmin installed on your local development environment. This post will show you how two options for installing.
First, you could simply install PHPMyAdmin as one of your web projects. In my case, I would store it under
Then I would add a virtual host for Apache. In my case, my default virtual host points to
~/workspace/dev. This way I can access as a subfolder any of these web tools under
localhost. For example, http://localhost/phpmyadmin.
However, this requires some set up. You're also responsible for updating PHPMyAdmin over time.
Now that I'm using Docker for my local development environment on macOS, I don't really need to mess with any of this. I can just add an additional service to my stack.
The official PHPMyAdmin image includes its own running web server and the PHPMyAdmin files. All you have to do is configure some connection details.
I added the following under my
1phpmyadmin: 2 image: phpmyadmin:latest 3 environment: 4 - PMA_HOST=db 5 - PMA_USER=dbuser 6 - PMA_PASSWORD=dbpass 7 - UPLOAD_LIMIT=20M 8 ports: 9 - 8080:8010 <<: *network
Pretty much all of the
environment section is optional. I like when PHPMyAdmin auto logs me in. So this configures with the same user credentials and host as I used for the
Since it's running on its own web server. I also set the
UPLOAD_LIMIT so I can easily import files from the browser.
Find this interesting? Let's continue the conversation on Twitter.