localhost/phpmyadmin

http://localhost/phpmyadmin

phpMyAdmin is a free web-based database management tool for MySQL and MariaDB. Access your local database at localhost/phpmyadmin after installing XAMPP, WAMP, MAMP, or standalone phpMyAdmin on your computer.

→ Open localhost/phpmyadmin

How to Access phpMyAdmin on Localhost

  1. Install XAMPP, WAMP, MAMP, or standalone phpMyAdmin on your system
  2. Start Apache web server and MySQL database services from control panel
  3. Open your web browser (Chrome, Firefox, Edge, Safari)
  4. Type localhost/phpmyadmin in the address bar
  5. Press Enter to access the phpMyAdmin login page
  6. Enter your database username and password credentials
  7. Click "Go" to login to phpMyAdmin dashboard

Default phpMyAdmin Login Credentials

Use these default username and password combinations to login to phpMyAdmin:

Server Software Username Password Notes
XAMPP (Windows/Linux) root (blank/empty) No password by default
WAMP (Windows) root (blank/empty) Leave password field empty
MAMP (Mac) root root Both username and password are "root"
LAMP (Linux) root (set during install) Password set during MySQL installation
Custom Installation (your username) (your password) Credentials you configured

What is phpMyAdmin Used For?

phpMyAdmin is a powerful database administration tool that allows you to:

  • Create and manage MySQL and MariaDB databases
  • Create, edit, delete, and modify database tables
  • Execute SQL queries and commands
  • Import databases from SQL files
  • Export databases to SQL, CSV, XML formats
  • Manage database user accounts and permissions
  • Backup and restore database data
  • Browse, search, and edit database records
  • Optimize and repair database tables
  • View database structure and relationships

Alternative phpMyAdmin URLs and Ports

If localhost/phpmyadmin doesn't work, try these alternative URLs:

  • localhost/phpmyadmin - Default XAMPP/WAMP URL
  • localhost:8080/phpmyadmin - Alternative HTTP port 8080
  • localhost/phpMyAdmin - Case-sensitive on Linux systems
  • 127.0.0.1/phpmyadmin - Using IP address instead of localhost
  • localhost/pma - Custom phpMyAdmin alias
  • localhost:80/phpmyadmin - Explicit port 80
  • localhost/dashboard - XAMPP dashboard with phpMyAdmin link

How to Fix "phpMyAdmin Not Working" Issues

Error: "Cannot connect: invalid settings"

This error means phpMyAdmin cannot connect to your MySQL/MariaDB database server.

  • Ensure MySQL or MariaDB service is running in XAMPP/WAMP control panel
  • Check database credentials in config.inc.php file are correct
  • Verify MySQL is listening on port 3306 (default MySQL port)
  • Check firewall is not blocking MySQL connections
  • Restart both Apache and MySQL services
  • Look for MySQL error logs in XAMPP/logs directory

Error: "#1045 - Access denied for user 'root'@'localhost'"

This is a MySQL authentication error indicating wrong username or password.

  • Try default credentials: username root with blank password
  • For MAMP, try username root with password root
  • Check if you set a custom MySQL root password
  • Reset MySQL root password using command line
  • Verify user privileges in MySQL database
  • Check config.inc.php has correct authentication details

Error: "Access forbidden! You don't have permission"

This error indicates phpMyAdmin access restrictions or permission issues.

  • Check Apache is running properly
  • Verify phpMyAdmin folder exists in htdocs directory
  • Check file and folder permissions (755 for folders, 644 for files)
  • Review httpd.conf Apache configuration file
  • Check .htaccess file isn't blocking access
  • Ensure phpMyAdmin configuration allows localhost access

Error: "The mysqli extension is missing"

PHP's MySQL extension is not enabled.

  • Open php.ini configuration file in text editor
  • Find line ;extension=mysqli
  • Remove semicolon to uncomment: extension=mysqli
  • Save php.ini and restart Apache web server
  • Check phpinfo() to verify mysqli is loaded

Error: "The mbstring extension is missing"

PHP's mbstring extension is required for phpMyAdmin.

  • Open php.ini file
  • Uncomment extension=mbstring
  • Save changes and restart Apache
  • Verify extension is loaded in PHP configuration

Error: "404 Not Found - The requested URL /phpmyadmin was not found"

phpMyAdmin is not installed or not in the correct location.

  • Verify phpMyAdmin folder exists in web server document root
  • Check folder name spelling and case (phpMyAdmin vs phpmyadmin)
  • Ensure phpMyAdmin is in htdocs folder for XAMPP
  • For WAMP, check it's in www folder
  • Reinstall phpMyAdmin if files are missing
  • Check Apache virtual host configuration

Error: "Wrong permissions on configuration file, should not be world writable"

Security warning about config.inc.php file permissions.

  • Change config.inc.php permissions to 644 on Linux
  • On Windows, remove write permissions for other users
  • Use command: chmod 644 config.inc.php
  • Restart web server after changing permissions
Start XAMPP Services (Command Line):
# Windows - Start XAMPP Control Panel xampp-control.exe # Linux - Start all services sudo /opt/lampp/lampp start # Linux - Start individual services sudo /opt/lampp/lampp startapache sudo /opt/lampp/lampp startmysql # Mac (MAMP) - Start services /Applications/MAMP/bin/start.sh # Check MySQL is running sudo /opt/lampp/lampp status
Check MySQL Service Status:
# Windows - Check if MySQL is running netstat -ano | findstr :3306 # Linux - Check MySQL service sudo systemctl status mysql sudo systemctl status mariadb # Start MySQL if stopped sudo systemctl start mysql # Mac - Check MySQL process ps aux | grep mysql

phpMyAdmin Configuration File Locations

Edit config.inc.php to configure phpMyAdmin database connection settings:

  • XAMPP Windows: C:\xampp\phpMyAdmin\config.inc.php
  • XAMPP Linux: /opt/lampp/phpmyadmin/config.inc.php
  • WAMP Windows: C:\wamp\apps\phpmyadmin\config.inc.php or C:\wamp64\apps\phpmyadmin\config.inc.php
  • MAMP Mac: /Applications/MAMP/bin/phpMyAdmin/config.inc.php
  • Ubuntu/Debian: /etc/phpmyadmin/config.inc.php
  • Standalone: Look in your phpMyAdmin installation directory

Important config.inc.php Settings

Key configuration options in phpMyAdmin config file:

// Database host (usually localhost or 127.0.0.1) $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL port (default is 3306) $cfg['Servers'][$i]['port'] = ''; // Database username $cfg['Servers'][$i]['user'] = 'root'; // Database password (blank for XAMPP default) $cfg['Servers'][$i]['password'] = ''; // Authentication type (config, cookie, http) $cfg['Servers'][$i]['auth_type'] = 'cookie'; // Blowfish secret for cookie authentication $cfg['blowfish_secret'] = 'GENERATE_RANDOM_32_CHAR_STRING';

How to Reset MySQL Root Password

  1. Stop MySQL service from XAMPP control panel
  2. Open command prompt as administrator
  3. Navigate to MySQL bin directory
  4. Start MySQL in safe mode: mysqld --skip-grant-tables
  5. Open new command prompt and run: mysql -u root
  6. Execute SQL: ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
  7. Flush privileges: FLUSH PRIVILEGES;
  8. Exit and restart MySQL normally
  9. Update password in config.inc.php if needed

phpMyAdmin Security Best Practices

  • Change MySQL root password immediately after installation
  • Never use phpMyAdmin on production servers exposed to internet
  • Restrict phpMyAdmin access by IP address in config
  • Use strong passwords with letters, numbers, and special characters
  • Keep phpMyAdmin updated to latest version for security patches
  • Enable two-factor authentication if available
  • Use HTTPS instead of HTTP for encrypted connections
  • Set proper file permissions on config.inc.php (644 or 600)
  • Disable root login and create separate admin users
  • Enable phpMyAdmin login timeout for inactive sessions
  • Review and limit user privileges - use principle of least privilege
Security Warning: After fresh XAMPP installation, phpMyAdmin is accessible without any password. This is extremely insecure. Always set a strong root password immediately: ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourStrongPassword123!';

Common phpMyAdmin Tasks and Queries

Create a New Database

CREATE DATABASE my_database;

Create a Database User

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; GRANT ALL PRIVILEGES ON my_database.* TO 'myuser'@'localhost'; FLUSH PRIVILEGES;

Import SQL File

  • Click on database name in left sidebar
  • Click "Import" tab
  • Click "Choose File" and select your .sql file
  • Click "Go" to import

Export Database Backup

  • Click on database name
  • Click "Export" tab
  • Select "Quick" or "Custom" export method
  • Choose SQL format
  • Click "Go" to download

phpMyAdmin Alternatives

Other database management tools you can use:

  • Adminer - Lightweight single-file database manager
  • MySQL Workbench - Official MySQL desktop GUI tool
  • HeidiSQL - Windows MySQL client
  • DBeaver - Universal database tool
  • TablePlus - Modern database client for Mac/Windows
  • Sequel Pro - MySQL client for Mac

Frequently Asked Questions

Why can't I access localhost/phpmyadmin?

Check that Apache and MySQL services are running, phpMyAdmin is installed in the correct directory, and you're using the right URL. Try 127.0.0.1/phpmyadmin or localhost:8080/phpmyadmin as alternatives.

What is the default phpMyAdmin username and password?

For XAMPP and WAMP, the default username is root with a blank password (no password). For MAMP, both username and password are root.

How do I change phpMyAdmin password?

Login to phpMyAdmin, go to User Accounts, click Edit for root user, and set a new password. Then update the password in config.inc.php file.

Can I use phpMyAdmin remotely?

Yes, but it's not recommended for security reasons. If you must, configure firewall rules, use HTTPS, restrict by IP, and use strong authentication.

Related Resources and Links