Skip to content

Change the database password (phpMyAdmin)

The database root password is used both by phpMyAdmin and by your FiveM server (mysql_connection_string line in server.cfg). Change it if you think it leaked, if a former staff member knew it, or simply to pick a stronger one.

  1. On the VPS dashboard, phpMyAdmin block, click Voir (Show) to reveal the current password, then Ouvrir phpMyAdmin (Open phpMyAdmin)
  2. Sign in with the root user and that password

phpMyAdmin home

  1. Modifier le mot de passe (Change password): changes the password of the account you are signed in with (root)

Click Modifier le mot de passe under Paramètres généraux (General settings):

Change password dialog

  1. Keep Mot de passe (Password) ticked, then type the new password in Saisir (Enter) and Saisir à nouveau (Re-type). The Force (Strength) gauge should be green (Fort / Strong)
  2. Or click Générer (Generate): phpMyAdmin creates a strong random password, shows it in the field on the right and fills both fields. Copy it right away
  3. Exécuter (Go) applies the change
  4. Annuler (Cancel) closes the dialog without changing anything

After Exécuter, phpMyAdmin signs you out: sign back in with the new password.

Then go to the final step.

Useful if phpMyAdmin isn’t reachable, or if you prefer the command line.

Fenêtre de terminal
ssh root@YOUR_VPS_IP

Your SSH credentials are in the VPS Security → SSH Access tab (see VPS security).

Fenêtre de terminal
mariadb -u root -p

Type the current database password (nothing shows while typing, that’s normal). The prompt becomes MariaDB [(none)]>.

Replace NewPassword with your password, keeping the quotes:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
FLUSH PRIVILEGES;
EXIT;

Both commands should answer Query OK.

Fenêtre de terminal
mariadb -u root -p -e "SELECT 'connection OK';"

Type the new password: the command should print connection OK.

If you no longer know the current password and Voir in the portal no longer works, you can reset it by restarting MariaDB without privilege checks:

Fenêtre de terminal
systemctl stop mariadb
mariadbd-safe --skip-grant-tables --skip-networking &
sleep 5
mariadb -u root

Then in the MariaDB console:

FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
EXIT;

Finally, restart MariaDB normally:

Fenêtre de terminal
mariadb-admin -u root -p shutdown
systemctl start mariadb
systemctl status mariadb --no-pager

Your FiveM server uses the password in the mysql_connection_string line of your server.cfg (or in a framework config file). Update it with the new password:

set mysql_connection_string "mysql://root:NewPassword@127.0.0.1/fivem?charset=utf8mb4"

Then restart the server from txAdmin and check the console shows no connection error (Access denied for user 'root').

  • Close MySQL to the public with Anti-DDoS restricted access: only your IPs will reach port 3306
  • For a script or a developer, create a dedicated user in Comptes utilisateurs → Ajouter un compte d’utilisateur (Add user account), with rights limited to the fivem database, instead of sharing root