How to reset the password for a MySQL database user's password?
Author: admin admin Reference Number: AA-00340 Views: 18999 Created: 2013-04-11 13:06 Last Updated: 2025-08-12 16:35 0 Rating/ Voters

How to Reset MySQL User Passwords in cPanel - Simple Guide

Table of Contents

  1. What You Need to Know
  2. Before You Start
  3. Step 1: Access cPanel
  4. Step 2: Find MySQL Databases
  5. Step 3: Reset the Password
  6. Step 4: Update Your Website Files
  7. Step 5: Test Your Website
  8. Getting Help

What You Need to Know

Important Warning

When you change a MySQL password, your website will stop working until you update your website's configuration files with the new password. This is because your website stores the database password in files, and those files need to be updated manually.

Why Reset MySQL Passwords?

  • For security reasons
  • If you forgot the password
  • If you think someone unauthorized has access
  • Regular maintenance

Before You Start

What You'll Need

  • Access to your cPanel account
  • Knowledge of which websites use the MySQL user you're changing
  • About 15-30 minutes to complete the process

Important Backup Step

Before changing any passwords, make a backup of your website files, especially configuration files. You can do this through cPanel ? Files ? File Manager.


Step 1: Access cPanel

Method 1: Through iFastNet Client Portal

  1. Go to https://ifastnet.com/portal/clientarea.php
  2. Log in with your iFastNet account details
  3. Find your hosting service and click "Login to cPanel"

Method 2: Direct Access

  1. Go to https://yourdomain.com/cpanel (replace "yourdomain.com" with your actual domain)
  2. Enter your cPanel username and password
  3. Click "Log in"

Step 2: Find MySQL Databases

  1. In cPanel, scroll down to the "Databases" section
  2. Click on "MySQL Databases"
  3. Scroll down to the "Current Users" section
  4. Find the user whose password you want to reset

Step 3: Reset the Password

  1. Next to the MySQL user, click "Change Password"
  2. Enter a new, strong password in the "Password" field
  3. Enter the same password again in the "Password (Again)" field
  4. Click "Change Password"
  5. You should see a success message

Creating a Strong Password

  • Use at least 12 characters
  • Include uppercase letters, lowercase letters, numbers, and symbols
  • Don't use personal information or common words
  • Consider using the password generator tool in cPanel

Step 4: Update Your Website Files

This is the most important step! Your website will be broken until you update these files.

For WordPress Sites

  1. Go to cPanel ? Files ? File Manager
  2. Navigate to your WordPress folder (usually public_html)
  3. Find and edit the file called wp-config.php
  4. Look for this line:
    define( 'DB_PASSWORD', 'old_password_here' );
    
  5. Replace old_password_here with your new password
  6. Make sure to keep the quotes around the password
  7. Save the file

Example:

// Before
define( 'DB_PASSWORD', 'myoldpassword123' );

// After
define( 'DB_PASSWORD', 'mynewpassword456' );

For Other Websites

Look for configuration files in your website folder that might contain the old password. Common file names include:

  • config.php
  • database.php
  • settings.php
  • .env

Update the password in these files the same way as WordPress.

For Custom Scripts

If you have any custom scripts or backup scripts that use the database, you'll need to update the password in those files too.


Step 5: Test Your Website

  1. Visit your website in a web browser
  2. Check that it loads properly
  3. Try logging into your admin area (WordPress admin, etc.)
  4. Test forms and other features that use the database

If Your Website Shows Errors

Common error messages after password changes:

  • "Error establishing a database connection"
  • "Database connection failed"

How to fix:

  1. Double-check that you updated the password correctly in your configuration files
  2. Make sure there are no extra spaces before or after the password
  3. Verify you used the complete username (usually includes your account name as a prefix)

Getting Help

iFastNet Support

If you need help:

  1. Support Portal: Go to https://support.ifastnet.com/login.php
  2. First time? You'll need to register for a support account
  3. Existing users: Log in and create a support ticket

What to Include in Your Support Request

  • Your domain name
  • The MySQL username you're trying to reset
  • Any error messages you're seeing
  • What you've already tried

Alternative Support Access

You can also access support through your client portal at https://ifastnet.com/portal/clientarea.php


Quick Troubleshooting

My website won't load after changing the password

Check these things:

  1. Did you update the password in your wp-config.php file (for WordPress)?
  2. Is the password exactly the same in both the MySQL user and your config file?
  3. Are there any extra spaces or characters in the password?

I can't find my configuration file

For WordPress: Look for wp-config.php in your main WordPress folder For other sites: Look for files named config.php, database.php, or similar

I'm getting permission errors

Contact iFastNet support - you might not have the right permissions to change MySQL passwords.


Remember: Always backup your files before making changes, and test your website after updating passwords to make sure everything works correctly.

Quick Jump Menu