localhost/phpmyadmin: how to open it and fix 404 or access denied
phpMyAdmin is the web tool for MySQL and MariaDB. How to open it in XAMPP, WAMP and MAMP, and fix 404, #1045 and #2002 errors.
Open this address: http://localhost/phpmyadminThis opens on your own computer. It only works if the program is running.
localhost/phpmyadmin opens phpMyAdmin, a web page for managing MySQL and MariaDB databases. It works only when Apache and MySQL are both running.
What runs on localhost/phpmyadmin
- Comes with XAMPP, WAMP, MAMP and Laragon
- On Linux you install it yourself
- Needs both Apache and MySQL running
How to open phpMyAdmin
- Open your control panel (XAMPP Control Panel, WAMP, MAMP) and start Apache and MySQL.
- Open http://localhost/phpmyadmin. If Apache uses another port, add it: http://localhost:8080/phpmyadmin.
- XAMPP login: user root, empty password. MAMP login: root and root.
Install phpMyAdmin on Linux
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-curlsudo systemctl restart apache2If localhost/phpmyadmin will not open
- 404 Not Found
- phpMyAdmin is not installed or not set up in Apache. On XAMPP the folder is C:\xampp\phpMyAdmin. On Linux, install it as shown above.
- This site can’t be reached
- Apache is not running, or it uses a different port. Check the control panel.
- #2002 Cannot connect: connection refused
- MySQL is not running. Start MySQL in the control panel.
- #1045 Access denied for user root
- The password is wrong. See MySQL access denied for root.
- Security
- Never leave phpMyAdmin open to the internet with a weak or empty password. It is meant for your own computer.
Questions about localhost/phpmyadmin
- What is the default phpMyAdmin login?
- On XAMPP and WAMP the user is root with an empty password. On MAMP it is root and root.
- Why does localhost/phpmyadmin show 404?
- phpMyAdmin is not installed in your web server folder, or Apache is not set up for it. Check the install folder, or install the package on Linux.
Config generators for this
- Docker Compose for MySQL and phpMyAdminRun MySQL and the phpMyAdmin web page on your computer with one docker compose command.