phpMyAdmin
What is phpMyAdmin?
phpMyAdmin is a web-based admin GUI for MySQL and MariaDB, browse tables, run queries, manage users, and import/export data without touching a command line. There's nothing to "install", Laradock builds it as its own container from the official phpmyadmin image and points it at whichever database container you're already running.
Start phpMyAdmin
Start it alongside the database it should manage:
# with MySQL
docker compose up -d mysql phpmyadmin
# with MariaDB
docker compose up -d mariadb phpmyadmin
Stop phpMyAdmin
docker compose stop phpmyadmin
Configuration
All settings live in phpmyadmin/defaults.env and can be overridden by adding the same line to your own .env:
| Variable | Default | What it does |
|---|---|---|
PMA_DB_ENGINE | mysql | Which service phpMyAdmin depends on and connects to by default: mysql or mariadb. |
PMA_USER | default | Username phpMyAdmin logs in with. |
PMA_PASSWORD | secret | Password for PMA_USER. |
PMA_ROOT_PASSWORD | secret | Root password passed through to the container. |
PMA_PORT | 8081 | Host-side port for the web UI (container port 80). |
PMA_MAX_EXECUTION_TIME | 600 | PHP max_execution_time, in seconds, for long-running queries/imports. |
PMA_MEMORY_LIMIT | 256M | PHP memory_limit for the container. |
PMA_UPLOAD_LIMIT | 2G | Max upload size, for importing large SQL/CSV files. |
Log in
Open http://localhost:8081. For the default MySQL setup, use server mysql, user default, password secret (or your own PMA_USER/PMA_PASSWORD).
Switch to MariaDB
- In
.env, setPMA_DB_ENGINE=mariadb. - Start
mariadbinstead ofmysql:docker compose up -d mariadb phpmyadmin. - Log in with server
mariadb.
Common issues
- "mysqli::real_connect(): (HY000/2002)" or similar connection error. phpMyAdmin
depends_on: ${PMA_DB_ENGINE}, meaning it starts alongside whichever enginePMA_DB_ENGINEnames, but if that container isn't actually up (or you changedPMA_DB_ENGINEwithout restarting), the login form has nothing to connect to. Confirm the matching database container is running:docker compose ps. - Login rejected. Double-check
PMA_USER/PMA_PASSWORDmatch the actual credentials on the target database (MYSQL_USER/MYSQL_PASSWORDorMARIADB_USER/MARIADB_PASSWORD), they're independent variables and can drift out of sync if you change one without the other. - Large import fails partway through. Raise
PMA_UPLOAD_LIMITandPMA_MAX_EXECUTION_TIMEin.env, then restart:docker compose up -d phpmyadmin. - Port already in use on your host. Change
PMA_PORTin.envand restart.
Prefer a lighter GUI, or need Postgres/SQLite too? See Adminer. Back to the Getting Started guide.