Updated: 9 November 2026 · Applies to: DirectAdmin (Evolution skin), MySQL 8.4 and MariaDB 11.8 (SQL tested), DBeaver (steps from DBeaver documentation)
To change a database user password in DirectAdmin, log in, open MySQL Management, open the database, pick the user and set a new password. Without the control panel, a user with the right privileges can run ALTER USER 'user'@'host' IDENTIFIED BY 'new-password'; in MySQL or MariaDB, or use Security > Change user password in DBeaver. In every case, put the new password into your website’s configuration straight away, or the site loses its database connection.
1. Change the password in DirectAdmin
- Log in to DirectAdmin (usually
https://your-server:2222; the address is in your welcome email). See logging in to your DirectAdmin account if you need help. - At user level, open MySQL Management.
- Select the database the user belongs to. The page lists the database users with access to it. Current DirectAdmin versions also have a separate page that lists every database user on the account.
- Choose the password option for the user (in the Evolution skin this is shown next to the user or on the user’s page).
- Type a new password or let DirectAdmin generate one, then save.
- Update your application with the new password (step 4 below).
Button labels move slightly between DirectAdmin releases; DirectAdmin rebuilt the database management page in version 1.659 with in-place editing instead of pop-up dialogs.
Two things to know, according to DirectAdmin:
- Changing your main DirectAdmin account password does not change your database user passwords (this changed in version 1.666, because changing them silently broke websites). Change each database user on its own.
- DirectAdmin always names databases and database users
username_name, with your account name as the prefix, for examplealice_wp. Use the full name in your application.
2. Change the password with SQL (ALTER USER)
On a VPS or dedicated server, or anywhere you have a MySQL or MariaDB administrator login, use ALTER USER. A MySQL account is a user name plus a host, so give both:
ALTER USER 'alice_wp'@'localhost' IDENTIFIED BY 'N3w-Strong-Pass';
Output:
Query OK, 0 rows affected (0.01 sec)
The change applies at once; you do not need FLUSH PRIVILEGES. We tested this on MySQL 8.4.11 and MariaDB 11.8.9: the new password logged in and the old one was refused with ERROR 1045 (28000): Access denied.
If the same user name exists for more than one host, each one has its own password. List them first:
SELECT User, Host FROM mysql.user WHERE User = 'alice_wp';
Output:
User Host alice_wp % alice_wp localhost
Run ALTER USER for every host that should get the new password. If you name a host that does not exist, both servers answer:
ERROR 1396 (HY000): Operation ALTER USER failed for 'alice_wp'@'10.0.0.5'
SET PASSWORD also works, with a slightly different syntax on each server:
SET PASSWORD FOR 'alice_wp'@'localhost' = 'N3w-Strong-Pass';
That is the MySQL 8.4 form. On MariaDB, wrap the password in PASSWORD():
SET PASSWORD FOR 'alice_wp'@'localhost' = PASSWORD('N3w-Strong-Pass');
MySQL 8.4 rejects PASSWORD() with a syntax error (ERROR 1064), because the function was removed. Old guides that run UPDATE mysql.user SET Password=... no longer work on either server: in our tests MySQL 8.4 returned ERROR 1064 and MariaDB 11.8 returned ERROR 1356, because mysql.user is now a view.
Changing your own password as a normal user
A user without administrator rights can still change their own password. On MySQL 8.4 both of these worked for an ordinary user:
ALTER USER CURRENT_USER() IDENTIFIED BY 'N3w-Strong-Pass';
SET PASSWORD = 'N3w-Strong-Pass';
On MariaDB 11.8, ALTER USER CURRENT_USER() was refused for an ordinary user (ERROR 1227, it needs the CREATE USER privilege), but this worked:
SET PASSWORD = PASSWORD('N3w-Strong-Pass');
If you have lost the root password itself, follow how to change or reset the MySQL root password instead.
3. Change the password in DBeaver
According to DBeaver’s documentation, you can change the password of the user you are connected as:
- Connect to the database.
- In the Connections panel, right-click the connection and choose Security > Change user password.
- Enter the new password in New Password and again in Verify Password, then select OK.
- When DBeaver asks whether to update the connection settings, choose Yes to save the new password with the connection. No keeps the old saved password, so the next connection fails.
DBeaver lists MySQL, PostgreSQL, SQL Server and Oracle among the databases that support this command. To change another user’s password, open an SQL editor on an administrator connection and run the ALTER USER statement from section 2. If the password was already changed elsewhere (for example in DirectAdmin) and DBeaver only needs the new one, right-click the connection, choose Edit connection, update the password, select Test Connection and then OK.
To reach a DirectAdmin database from DBeaver on your computer, the database user also needs your IP address in its allowed access hosts. DirectAdmin allows up to 30 access hosts per database user.
4. Update your application
Your website keeps using the old password until you change it in its configuration file. Common places:
- WordPress:
define( 'DB_PASSWORD', '...' );inwp-config.php. - Other applications: look for the database password in the application’s configuration file or
.envfile, next to the database name and user name.
Then load the site. “Error establishing a database connection” usually means the password in the file does not match, or the user name is missing its account prefix.
Related: add a new database user in DirectAdmin and modify user privileges for a database in DirectAdmin.
Official documentation: MySQL ALTER USER statement, MariaDB ALTER USER, DBeaver: change current user password and DirectAdmin 1.666 changelog.