Where phpMyAdmin stores your login credentials
Your phpMyAdmin username and password are usually stored in a configuration file on your web server, not in phpMyAdmin itself. The file you need is called config.inc.php, and it lives in the phpMyAdmin directory on your hosting account. You cannot retrieve a forgotten password from within phpMyAdmin — you have to access the server files directly.
The location of this file depends on how your hosting provider set up phpMyAdmin. Common paths include /usr/share/phpmyadmin/config.inc.php on Linux servers or C:\xampp\phpmyadmin\config.inc.php if you are running XAMPP locally on Windows. If you do not know where phpMyAdmin is installed, your hosting provider's control panel or documentation will tell you.
Key Takeaways
- phpMyAdmin credentials are stored in the config.inc.php file on your server, which you access through your hosting control panel or FTP client, not through phpMyAdmin itself.
- The username and password appear in plain text in the configuration file, usually on lines that start with $cfg['Servers'][1]['user'] and $cfg['Servers'][1]['password'].
- If you cannot find the config file, contact your hosting provider — they can tell you the correct path or reset the credentials for you.
- Never share your config.inc.php file or its contents with anyone, because it contains the credentials needed to access all your databases.
Accessing the config file through your hosting control panel
Most hosting providers give you a file manager built into your control panel — cPanel, Plesk, or a similar tool. Log into your hosting account, find the file manager, and navigate to the phpMyAdmin directory. Look for the folder named phpmyadmin or ask your provider which directory phpMyAdmin uses.
Once you are in that directory, find config.inc.php and open it with the built-in text editor. Search the file for the lines that contain your username and password. They will look like this:
$cfg['Servers'][1]['user'] = 'your_username'; $cfg['Servers'][1]['password'] = 'your_password';
The text between the single quotes is your actual username and password. Copy them exactly as they appear, including any special characters.
Using FTP or SFTP to find the credentials
If your hosting control panel does not have a file manager, you can use an FTP client like FileZilla or WinSCP to connect to your server. You will need your FTP username, password, and server address — your hosting provider sends these when you sign up.
Connect to your server, navigate to the phpMyAdmin directory, and read the config.inc.php file to your computer. Open it with a plain text editor like Notepad (Windows), TextEdit (Mac), or gedit (Linux). Do not use a word processor like Microsoft Word, because it will add formatting that breaks the file.
Search for the lines containing your username and password, copy them, and then delete the downloaded file from your computer. Never leave a copy of this file sitting on your local machine.
What to do if you cannot find the config file
If the phpMyAdmin directory does not contain config.inc.php, or if you cannot locate the phpMyAdmin directory at all, contact your hosting provider's support team. Tell them you need to find your phpMyAdmin credentials and ask them for the correct file path or the credentials themselves.
Some hosting providers set up phpMyAdmin with a different configuration method or store credentials in a database instead of a file. Your provider can either give you the credentials directly or walk you through the steps to retrieve them. This usually takes less than an hour.
Resetting phpMyAdmin credentials if you have server access
If you have access to the config.inc.php file but want to change your credentials, you can edit the file directly. Open it in a text editor, find the lines with your username and password, and replace them with new values. Make sure the new password is enclosed in single quotes and does not contain unescaped single quotes itself.
Save the file and upload it back to your server if you downloaded it. The next time you log into phpMyAdmin, use your new username and password. Test the login when ready to make sure the change worked.
Protecting your phpMyAdmin credentials after you find them
Once you have your username and password, store them in a password manager like Bitwarden, 1Password, or KeePass rather than writing them down or saving them in a text file. A password manager encrypts your credentials and makes them available only when you unlock it with a master password.
Never share your phpMyAdmin username and password with anyone except a hosting provider's support staff if they specifically ask for it during troubleshooting. Your phpMyAdmin account has access to every database on your hosting account, so treating it like a root password is the right approach.
Frequently Asked Questions
Can I reset my phpMyAdmin password without accessing the config file?
Not directly through phpMyAdmin itself. You must either edit the config.inc.php file or contact your hosting provider and ask them to reset it for you. Some providers offer a password reset option in their control panel, so check there first before editing the file manually.
What if the password in config.inc.php is encrypted or hashed?
phpMyAdmin stores passwords in plain text in the config file by default, so you should see the actual password. If you see a long string of characters that looks encrypted, your hosting provider may have set up a custom configuration. Contact them for the actual credentials.
Is it safe to leave my phpMyAdmin password in the config file?
Yes, as long as only you and your hosting provider can access the server files. The config.inc.php file is not publicly visible on the internet. However, if your server is compromised, an attacker could read it. Use a strong, unique password and keep your server software updated to reduce that risk.
Can I change my phpMyAdmin username?
Yes. Edit the config.inc.php file and change the value next to $cfg['Servers'][1]['user'] to your new username. The new username must be a valid MySQL or PostgreSQL user on your server. If you are unsure whether the username exists, contact your hosting provider.
What should I do if I find credentials that are not mine in the config file?
Contact your hosting provider when ready. This could indicate that someone else has access to your account or that your server has been compromised. Your provider can investigate and help you find your account.