How databases and database users are named

Database and user names are always prefixed with your cPanel account name and an underscore. You cannot change this and every account on the server works the same way.

What that looks like

If your account is example and you type shop as the name, the database created is example_shop. The same applies to database users: typing shopuser produces example_shopuser.

Why it works this way

Many accounts share one database server, and the prefix guarantees your names can never collide with anyone else's. It also means a name is unmistakably yours.

The full name is what you need

When configuring an application, use the full prefixed name in both the database and username fields. Entering just the part you typed is one of the most common reasons an installation cannot connect.

The length limit

Names are limited in length, and your prefix counts towards it. An eight-character account name plus an underscore leaves noticeably less than you might expect. If a name is rejected as too long, shorten the part you chose rather than trying to work around it.

This catches people restoring a site from another host: the old database was oldaccount_shop and here it becomes newaccount_shop. The name in your configuration file must be updated to match, or the site will not connect.

Naming sensibly

With one database, the name hardly matters. With several, use something that says which application it belongs to – _wp, _shop, _forum. When you come to delete an old one, you will be glad you can tell them apart.

  • 32 Users Found This Useful
Was this answer helpful?

Related Articles

Managing your MySQL databases

Everything to do with databases is in cPanel, in two places: MySQL Databases for creating and...

Creating a database and a database user

An application needs two things: a database to store data in, and a user with permission to use...

Using phpMyAdmin without breaking anything

phpMyAdmin, in cPanel, gives you direct access to your data. That is useful and it is also the...

Importing a large database

phpMyAdmin has an upload size limit, and a large database import will fail part-way through...

Connecting to MySQL from your own computer

By default, databases only accept connections from the server itself. That is deliberate: it...