Skip to content
Free website migration on every plan, done by our team.Learn more ›
Guides

What is a database in web hosting (MySQL and MariaDB)?

What a website database is, what it stores, how MySQL and MariaDB work with WordPress, and how to create, back up and manage databases in cPanel.

Short answer: A database is where a website stores its changing content in an organised way: posts, pages, products, orders, users and settings. Most websites use MySQL or MariaDB, and on cPanel hosting you create and manage databases in a few clicks, with phpMyAdmin to view and edit them. Back it up as carefully as your files: for many sites, it is the most valuable part.

A website has two halves: files (code, themes, images) and a database (the content and data). Understanding the database helps you move, back up and troubleshoot your site with confidence.

What a database stores

For a WordPress site, the database holds:

  • posts, pages and their revisions;
  • comments and users;
  • site settings, menus and widget settings;
  • plugin data, such as form entries or SEO settings;
  • for shops, products, orders and customers.

Images and other uploads are stored as files, but the database records where they are.

How it works

A database is organised into tables (like spreadsheets), each with rows and columns. When someone visits a page, PHP asks the database for the right rows, then builds the page. See what is PHP.

MySQL vs MariaDB

MariaDB began as a community fork of MySQL and works as a drop-in replacement for most websites, including WordPress. Many hosts use one or the other; your site won't notice the difference. See MySQL vs MariaDB.

Databases in cPanel

  1. Create a database: cPanel → Manage My Databases (or MySQL Database Wizard), then choose a name.
  2. Create a user with a strong password.
  3. Add the user to the database with the privileges it needs (usually all, for a website).
  4. Use phpMyAdmin to browse tables, run queries, import and export.

One-click installers such as Softaculous create the database for you when you install WordPress. See how to install WordPress.

Connecting a website to its database

WordPress keeps the connection details in wp-config.php: the database name, user, password and host (usually localhost). If these don't match, you'll see "Error establishing a database connection". See fixing database connection errors.

Backing up and moving a database

  • Export it from phpMyAdmin (Export → Quick → SQL) or use your host's backup tools.
  • Import it on the new host with phpMyAdmin, then update wp-config.php.
  • Back it up before every update, and often for shops. See WordPress backups and the 3-2-1 rule.

Moving to AuroxHost? Our team moves files and databases for you during a free migration.

Keeping a database fast

  • Delete old post revisions, spam comments and expired temporary data. See WordPress database clean-up.
  • Remove tables left behind by plugins you've deleted.
  • Use object caching such as Redis on busy sites. See Redis object cache.
  • Fast storage helps: NVMe drives make database-heavy sites noticeably quicker.

Keeping it secure

  • Use a unique, strong password for each database user.
  • Don't reuse the same database user across several websites.
  • On a VPS, don't expose the database port to the internet; connect locally or through SSH. See first steps on a VPS.

Frequently asked questions

How many databases do I get?

It depends on the plan. AuroxHost's Web Starter includes 10, Web Pro 50 and Web Premium 100.

Do I need a database for my website?

If it's WordPress, a shop or any app with logins or changing content, yes. A plain HTML site doesn't. See static website hosting.

Can I access my database from my computer?

Yes, with a desktop tool, if you add your IP in cPanel's Remote MySQL. Find your address on our What is my IP page.

Why is my database so large?

Usually revisions, logs, statistics or old plugin data. Clean it up and remove plugins that log heavily.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.