cPanel Databases

cPanel includes tools for creating, managing and connecting to databases used by many websites and web applications. If you run a WordPress site, a custom PHP application, a shopping cart, a forum or another dynamic website, there is a strong chance it relies on a database to store content, settings, user accounts and other important information.

This article explains what databases in cPanel are, why they matter, how they are commonly used, and how to manage them safely. It is written as a general guide to the topic rather than a provider-specific document, so it can be used as a helpful reference for anyone working with cPanel hosting.

What databases do in cPanel

A database is a structured way of storing information so that a website or application can read, add, update and remove data efficiently. In cPanel hosting, databases are usually used alongside a website's files. The files provide the application code and design, while the database stores the changing content and configuration behind the scenes.

Common examples of information stored in a database include website posts and pages, user logins, product catalogues, order records, contact form submissions, plugin settings and application preferences.

On many cPanel servers, the available database engine is MySQL or MariaDB. MariaDB is a MySQL-compatible database server, so in most day-to-day cPanel use, the tools and concepts are very similar.

Common database tools in cPanel

cPanel usually provides a small group of database management tools. The exact menu names can vary slightly between themes or hosting environments, but the most common options include the following.

* MySQL Databases

Used to create databases, create database users, reset user passwords and assign users to databases with specific privileges.

* MySQL Database Wizard

A guided version of the setup process that helps beginners create a database, create a user and assign permissions step by step.

* phpMyAdmin

A browser-based database management tool that lets you view tables, run queries, import or export data and inspect the contents of a database directly.

* Remote MySQL

Used when an external server or application needs permission to connect to your database remotely. This is not required for most standard websites hosted in the same cPanel account.

How databases are named in cPanel

In cPanel, database names and database usernames are commonly prefixed with the cPanel account username. For example, if the cPanel account username is example and you create a database called shop, the full database name may appear as example_shop.

This is normal behaviour in cPanel and helps keep databases separated across hosting accounts. When configuring an application, always use the full database name, full database username and the correct password.

Before you create or change a database

Before working with databases in cPanel, make sure you understand what application is using the database and whether the change may affect a live website.

* Confirm which website or application the database belongs to.

* Back up the website files and database before making changes.

* Record the current database name, username and connection settings.

* Check whether the application has its own configuration file that will need updating.

* Avoid deleting unused-looking databases unless you are certain they are no longer required.

Database changes can cause websites to stop working if credentials are entered incorrectly, if permissions are removed or if data is deleted accidentally.

How to create a database in cPanel

If you need a new database for a website or application, you can usually create it from the MySQL Databases area or with the MySQL Database Wizard.

1. Log in to cPanel.

2. Open MySQL Databases or MySQL Database Wizard.

3. Enter a name for the new database and create it.

4. Create a database user.

5. Choose a strong password for the database user and store it securely.

6. Add the user to the database.

7. Assign the required privileges to that user.

8. Save the full database name, username and password for the application setup.

For many common applications, the database user will need full privileges on that specific database so the software can create tables and update data correctly.

How to assign a user to a database

Creating a database and creating a user are only part of the process. The user must also be linked to the database with the appropriate permissions.

1. In cPanel, open MySQL Databases.

2. Find the section for adding a user to a database.

3. Select the correct database user.

4. Select the correct database.

5. Click to add the user.

6. Choose the required privileges.

7. Save the changes.

If this step is missed, the website or application may show a database connection or permission error even if the username and password are correct.

Using phpMyAdmin

phpMyAdmin is one of the most useful database tools in cPanel. It provides a browser-based interface for working directly with your database tables and records.

With phpMyAdmin, you can:

* Browse tables and inspect stored data.

* Import an SQL backup file.

* Export a database backup.

* Run SQL queries manually.

* Repair or optimise selected tables.

* Check table structures, indexes and collation settings.

phpMyAdmin is powerful, but it should be used carefully. Direct changes to records, tables or SQL queries can break a website if they are applied incorrectly.

Importing and exporting databases

Importing and exporting are common tasks when migrating a website, restoring from a backup or moving data between development and live environments.

To export a database in phpMyAdmin:

1. Open phpMyAdmin in cPanel.

2. Select the database from the left-hand menu.

3. Click Export.

4. Choose the preferred export method.

5. Download the SQL file.

To import a database in phpMyAdmin:

1. Open phpMyAdmin in cPanel.

2. Select the target database.

3. Click Import.

4. Choose the SQL file from your device.

5. Start the import process.

Large database imports may fail if the hosting account has upload, execution time or memory limits. In those cases, you may need an alternative import method or hosting support assistance.

Common database connection details

Most web applications ask for a small set of database connection details during installation or configuration.

* Database name

* Database username

* Database password

* Database host

In many standard cPanel hosting environments, the database host is localhost. However, this is not universal, so you should always confirm the correct value for your hosting environment or application documentation.

Common database problems in cPanel

Database-related issues often appear after a migration, password change, manual edit or application update. Some of the most common problems include the following.

* Incorrect database name

The application may be using a short name instead of the full cPanel-prefixed database name.

* Incorrect database username or password

If the credentials in the application configuration do not match the credentials in cPanel, the site may fail to connect.

* User not assigned to the database

The user may exist, but it may not have been added to the database or granted the required privileges.

* Corrupt tables

A database table may become damaged due to interrupted writes, server issues or application problems.

* Wrong database host

If the application expects localhost but another hostname is entered, the connection may fail.

* Import limitations

Large SQL files may not import successfully through phpMyAdmin because of hosting limits.

* Application configuration errors

The website's configuration file may still point to old database details after a migration or reset.

Troubleshooting database issues

If a website reports a database connection problem in cPanel hosting, work through the basics carefully.

1. Confirm the correct full database name.

2. Confirm the correct full database username.

3. Reset the database user password if necessary.

4. Check that the user is assigned to the database.

5. Confirm the required privileges are enabled.

6. Review the application's configuration file.

7. Confirm the database host value.

8. Test with phpMyAdmin to verify the database exists and is accessible.

9. Restore from backup if data has been lost or corrupted.

If the issue started after a migration, also check whether table prefixes, collation settings or serialised configuration values inside the application need attention.

Security and best practices

Databases often contain sensitive information, so good security practices are important.

* Use strong, unique database passwords.

* Give each application its own database where practical.

* Avoid reusing one database user across unrelated applications.

* Remove old or unused database users only after confirming they are no longer needed.

* Keep the website application, themes and plugins up to date.

* Take regular database backups.

* Restrict remote database access unless it is genuinely required.

* Be cautious when editing records directly in phpMyAdmin.

Good database management helps reduce the risk of downtime, data loss and unauthorised access.

When you might need a database in cPanel

You will commonly need to work with databases in cPanel when:

* installing WordPress, Joomla, Drupal or another CMS

* setting up an eCommerce platform

* migrating a website from another host

* restoring a site from backup

* troubleshooting a database connection error

* changing an application's configuration

* manually inspecting or exporting website data

Related articles

* MySQL Database Wizard

* phpMyAdmin

* How to Back Up a Website in cPanel

* How to Restore a MySQL Database

* How to Fix a Database Connection Error in WordPress

* Remote MySQL in cPanel

* File Manager (cPanel)

Need more help?

You can contact Apexhost support at support@apexhost.com.au

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Getting Started with cPanel

This article introduces cPanel for Apexhost customers and explains what it is...

Logging into cPanel

cPanel is the main control panel used to manage Linux hosting services. If...

cPanel File Manager

File Manager in cPanel is a browser-based tool that allows you to view,...

cPanel Passwords

cPanel hosting passwords protect access to your hosting control panel, email...

cPanel Contact Information

Keeping your cPanel contact information up to date helps ensure you receive...