Your Database User Should Not Be root

Only 0.1% of sites get this wrong, but the failure is total. A root database user means one SQL injection reaches every database on the server.
How common is this?
- 0.1% of the Joomla sites we have this data for fail this check. Platform: Joomla.
Measured across the sites we audit, on each site's most recent snapshot.
What this check and mySites.guru tool looks at on your site
Joomla stores the database username it connects with inside configuration.php, in plain text. This check reads that value and flags one specific case: a database username of root. It is one of a family of automated database checks mySites.guru runs on every snapshot; see how to check Joomla database security for the fuller picture.
How one SQL injection becomes a whole-server breach
This is a rare failure, not a common one. It shows up on roughly 0.1% of the Joomla sites we audit, so if you are reading this because your own check passed, this is not where your attention needs to go. But rare is not the same as unimportant. Where it does happen, the consequence is about as bad as a database misconfiguration gets.
MySQL’s root account is not scoped to a single database. It is a server-wide superuser: it can read, write, create, alter and drop every database on that MySQL server, not just the one Joomla was set up to use. It also carries privileges that have nothing to do with data at all. The FILE privilege, which a root-level account normally has, lets a connected user read arbitrary files off the server’s disk with LOAD_FILE() and write files back out with SELECT ... INTO OUTFILE, entirely outside of any database. In practice that means a SQL injection flaw combined with a root database connection is not just a data breach; it can be a path to reading configuration.php on every other site on the box, or writing a new file straight onto the server’s disk.
Most shared hosting boxes run several customers’ databases side by side on the same MySQL server. If your Joomla site connects as root and something exposes those credentials, an attacker does not just get your Joomla data. Depending on how the host has isolated accounts, they can potentially reach every other database on the same server too. This is one reason the failure rate for this check is as low as it is: most hosts either refuse to hand out root credentials for anything but server administration, or restrict which hosts and accounts the root user is even allowed to connect from, so the door is closed before Joomla is ever installed. Where it is not closed is usually a smaller VPS or self-managed server, where whoever set it up took the path of least resistance and used the one account they already had.
Credentials get exposed in ways that have nothing to do with Joomla being weak. A misconfigured backup leaves configuration.php downloadable. A separate vulnerable extension allows local file inclusion. A different site on the same server gets compromised first and its own weak point is used to pivot. In any of those situations, the difference between a scoped database user and root is the difference between “one site’s data is exposed” and “the entire server is exposed.”
There is a second, quieter risk. An attacker who reaches a root connection can create their own database users with the same superuser privileges. Even if you notice the compromise and change the root password, a second account they created earlier can still get them back in, because you were never looking for it.
The privileges a database user should actually have
A dedicated database user, created specifically for this site, with privileges scoped to only the single database Joomla needs: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER and INDEX. Some extensions also need CREATE TEMPORARY TABLES and LOCK TABLES. Server-level privileges such as FILE, PROCESS, SUPER, GRANT OPTION and SHUTDOWN should never be assigned to a website’s database user, regardless of what username it runs under.
How to fix it
- In your hosting control panel, create a new MySQL user with a strong, unique password. Most hosts provide this under a MySQL Databases or Database Users section in cPanel or Plesk.
- Grant that new user privileges on only the one database Joomla uses, not on every database on the account.
- Update
configuration.phpin your site’s root folder with the new$userand$passwordvalues. This cannot be changed from inside Joomla’s Global Configuration screen; it has to be edited directly in the file, or via SFTP if your host provides file access. - Log in to
https://yoursite.com/administratorand confirm the site still connects and loads correctly. - Once you have confirmed the new user works, delete the old
root-based connection from the database server entirely. Do not leave it dormant. - If there is any chance the site has been compromised in the past, change the actual MySQL
rootpassword too, and check for any unexpected additional MySQL users that were not created by you or your host.
What mySites.guru does about it
We check the configured database username on every snapshot and flag a match against root. There is no one-click fix for this, because creating a new database user and migrating the credentials is an infrastructure change that has to happen at the hosting level, so we flag it and point you to the fix rather than attempting it for you.
This check pairs with three others in the same family: whether your database prefix is still the guessable default, whether your database user can see other databases on the server, and whether leftover installer backup tables are sitting in your live database.
Your Database User Should Not Be root
mySites.guru checks every connected site for this automatically and flags it the moment it appears. These run twice a day on every connected site.