How to create a database in your control panel
Creating a database and a database user, and where to find the connection details afterwards.
Almost every dynamic website — WordPress included — stores its content in a database rather than in plain files. Posts, pages, product listings, user accounts and settings all live in tables inside a MySQL (or MariaDB, which is compatible with it) database, and the application reads from and writes to it every time someone visits the site or you make a change.
If you are installing something yourself rather than using a one-click installer, you need to create that database — and the user that is allowed to access it — before the application's own installer can run.
Creating the database
Open the section of your control panel that deals with databases. Create a new database and give it a name. Many hosting platforms automatically prefix the name with something tied to your account, which is normal and not something to fight against — it exists so that different customers' database names never collide on a shared server.
Once a prefix is applied, the database's actual name is longer than what you typed. Copy the full name shown after creation rather than assuming it matches what you entered — this is the single most common reason a fresh application install fails to connect on the first try.
Creating a database user
A database on its own does not let anything connect to it — a user account with a password is what an application actually authenticates with. Create one with a strong, unique password of its own; do not reuse your control panel password or the password for the site's admin account. If this password is ever exposed, you want it to compromise only that one database.
Granting access
Creating a user and creating a database are two separate steps, and a third step — granting that user access to that database — connects them. Most control panels present this as adding the user to the database and choosing a privilege level. For a standard application like WordPress, full privileges on its own database is normal; there is rarely a reason to restrict this further on a single-site setup.
What you end up with
By the end of this process you should have four pieces of information, all of which an application's setup screen will ask for:
| Detail | Where it comes from |
|---|---|
| Database name | What you named it, including any automatic prefix |
| Database username | What you named the user, including any automatic prefix |
| Database password | The password you set when creating the user |
| Database host | Usually localhost on shared hosting — shown in your control panel |
A password manager, or at minimum a private note, saves you from having to reset a database password later purely because you cannot recall it. Unlike your control panel login, there is no "forgot password" link buried in the application itself if this one goes missing — you would have to change it from the control panel and update the application's configuration to match.
What to do with the database once it exists
An empty database does nothing on its own. What happens next depends on what you are setting it up for:
- Installing an application through a one-click installer — the installer typically creates and connects the database for you, in which case you may not need to do any of the above manually. See installing an application in one click.
- Installing an application manually — its own setup screen will ask for the four details above during installation.
- Restoring an existing site's content — you will import a database backup file into this new, empty database using phpMyAdmin. See how to use phpMyAdmin.
If something will not connect
- Double-check the full, prefixed names. This causes more failed connections than any other single mistake.
- Confirm the user is actually attached to that database. Creating both separately does not connect them automatically — the grant step has to happen too.
- Retype the password rather than trusting memory or a screenshot. A password with a character that is easy to mistype — a capital
I, a lowercasel, a zero versus the letter O — is a common source of "wrong password" errors that are really typos. - Check the host value your panel actually shows.
localhostis standard on shared hosting, but do not assume it without checking if your panel states something different.
Once the database is in place and connected, working with its contents directly — browsing tables, running a query, importing or exporting data — is what phpMyAdmin is for. Our guide to using phpMyAdmin picks up from here.
Frequently asked questions
What do I put as the database host?
On shared hosting this is very commonly localhost, meaning the database server and the website files are on the same machine as far as the application is concerned. Your control panel will show the exact value to use if it differs.
How many databases can I create?
This depends on your hosting plan. Check the databases section of your control panel or your plan details if you are not sure of your limit — it is usually shown alongside the option to create a new one.
Related reading
Opening phpMyAdmin from your control panel and using it to browse, edit, import and export a database.
How to create a MySQL database and userEvery application needs a database, a user, and that user attached to the database — here is the order to do it in.
Why is my database host "localhost"?It means "this same machine" — not a placeholder, and not something to change unless you actually need to.
A tour of your hosting control panelThe main sections you will find in your control panel and roughly what lives in each one.