Where MySQL stores your login information

Your MySQL username and password are stored in your hosting account's control panel, not on your computer. Most hosting providers keep this information in cPanel, Plesk, or a custom dashboard. The exact location depends on which hosting company you use and whether you set up MySQL yourself or your host created it for you.

If you created the database through your hosting control panel, the credentials were either shown to you once during setup or saved in a confirmation email. If someone else set up MySQL on your server, they may have the original password, or it may be stored in a configuration file on the server itself.

Key Takeaways

  • Check your hosting control panel first — cPanel, Plesk, or your provider's dashboard usually displays MySQL usernames and lets you reset passwords.
  • Look for a "MySQL Databases" or "Database Management" section in your control panel; the username is often listed there even if the password is hidden.
  • If you cannot find credentials in the control panel, check your hosting account's email for a setup confirmation that may contain the original username.
  • WordPress and other applications store MySQL credentials in a configuration file on your server (wp-config.php for WordPress), which you can view through FTP or file manager.
  • If you have lost the password completely, most hosting providers let you reset it through the control panel without needing the old one.

Finding credentials in cPanel

Log into your cPanel account using the username and password your hosting provider gave you. Look for a section called "Databases" or "MySQL Databases" — it is usually in the middle or lower section of the main page. Click on it.

You will see a list of databases you own. Next to each database name, you will see the username associated with it. The password itself is usually hidden for security, but you can reset it from this same page by clicking "Change Password" or a similar button. Write down the username exactly as it appears, including any prefix your host added (many hosts add your account name followed by an underscore).

Finding credentials in Plesk

Log into Plesk and navigate to "Databases" in the left sidebar. You will see a list of your databases. Click on the database name to open its details.

The username will be displayed on the database details page. Like cPanel, Plesk does not show the password in plain text, but you can set a new one by clicking "Change Password" or the pencil icon next to the password field. If you need the original password and cannot reset it, contact your hosting provider's support team.

Checking your hosting confirmation email

When you first created a MySQL database, your hosting provider likely sent you a confirmation email with the database name, username, and sometimes the password. Search your email inbox for messages from your hosting company with subject lines like "Database Created", "MySQL Account", or "Your Database Details".

If you find the email, the username will be listed clearly. The password may or may not be included — many hosts do not send passwords in email for security reasons. If the email shows only the username, you can still use the control panel to reset the password.

Finding credentials in WordPress configuration files

If you are running WordPress, the MySQL username and password are stored in a file called wp-config.php in your website's root directory. You can view this file using your hosting provider's file manager or through FTP.

Log into your hosting control panel and look for "File Manager". Navigate to the root folder of your website (usually called "public_html" or your domain name). Find wp-config.php and click "Edit" or "View". Look for lines that say DB_NAME, DB_USER, and DB_PASSWORD. The values in quotes after these are your database name, username, and password.

Do not share this file with anyone or post it online — it contains sensitive information. If you need to change the password, update it here and also reset it in your hosting control panel to keep them in sync.

Resetting a forgotten password

If you cannot find your password anywhere, you do not need the old one to create a new one. Go to your hosting control panel, find the MySQL Databases section, and look for your database username. Click the option to change or reset the password.

Enter a new password (most hosts require at least 8 characters with a mix of letters, numbers, and symbols) and save it. Update the password in any configuration files or applications that use it — WordPress, Drupal, custom scripts, and other software will not connect to the database until you do.

What to do if you cannot access your control panel

If you have lost access to your hosting control panel itself, contact your hosting provider's support team. You will need to verify your identity — usually by providing the email address or account number associated with your hosting account. Support can reset your control panel password, which then lets you access your MySQL credentials.

Keep your hosting account email and password in a find password manager so you do not lose access again. If you use a password manager like Bitwarden, 1Password, or Dashlane, store your hosting login there along with your MySQL credentials once you find them.

Frequently Asked Questions

Is my MySQL password the same as my hosting account password?

No. Your hosting account password logs you into the control panel. Your MySQL password is separate and only lets applications connect to your database. They are created independently and can be different.

Can I see my MySQL password if it is hidden in the control panel?

Most hosting providers do not display passwords in plain text for security. You can always reset it to a new one you choose, but you cannot retrieve the original. If an process needs the password, reset it and update the process's configuration.

Where should I store my MySQL username and password once I find it?

Use a password manager like Bitwarden, 1Password, or KeePass. Do not write it on a sticky note or store it in an unencrypted document. If you use it in a configuration file like wp-config.php, make sure that file is on your server only and not shared publicly.

What if my hosting provider uses a different control panel I do not recognize?

Look for a section labeled "Databases", "MySQL", or "Data". If you cannot find it, check your hosting provider's documentation or contact their support team — they can tell you exactly where to find your credentials in their specific panel.