Skip to content
ContactWebmailCustomer panel

WordPress & Websites

How to Change a MySQL Database User's Password? 

Guide: How to change a MySQL database user's password? 

Changing the Password Affects Your Application

WordPress and other systems store their MySQL connection details in a configuration file. After changing the database user's password, you need to update that file right away. Otherwise, the site will show a connection error even though the database itself still exists.

Before making the change, save a copy of the configuration and make sure you know which user the application actually uses. A single database can have several accounts with different permissions.

  • check which user is assigned to the database
  • generate a strong password
  • update the application's configuration
  • test the site and any scheduled tasks

Common Problems After the Change

If the application can't connect to the database, check for typos, the database host, and the user's permissions. In WordPress, these details are usually found in wp-config.php. Other applications may use a .env file or a separate configuration file.

Don't restore the old, weak password just to get the site working again. It's better to fix the connection details and make sure the configuration file isn't publicly accessible.

After Changing the Password, Update Your Site's Configuration

Changing a MySQL user's password in Plesk is only safe once that same password has been entered in the application's configuration too. In WordPress, that's the wp-config.php file; for online stores, it's the equivalent configuration file for that system.

If the password was changed following a security incident, it's also worth checking the CMS panel's users, whether plugins are up to date, and the error logs.