How do I use MySQL databases?

This guide explains how to create and manage MySQL databases in cPanel, which are required for applications like WordPress, Joomla, and many other websites. If you're setting up a new website on your Irish hosting account (.ie or .com domain), this is an essential step.


What is a MySQL Database?

A MySQL database stores your website’s content, such as pages, posts, user data, and settings. Most modern websites require both:

  • A database
  • A database user with permissions

Step 1: Log into cPanel

  1. Go to your cPanel login URL (e.g. https://yourdomain.ie/cpanel)
  2. Enter your username and password
  3. Scroll down to the Databases section
  4. Click on MySQL® Databases

Step 2: Create a New Database

  1. Under Create New Database, enter a name
  2. Click Create Database

Note: Your database name will automatically be prefixed with your cPanel username (e.g. cpuser_mydb).


Step 3: Create a Database User

  1. Scroll down to MySQL Users
  2. Enter a username
  3. Enter a strong password (use the Password Generator if needed)
  4. Click Create User

Tip: Always store your database username and password securely.


Step 4: Assign User to Database

  1. Scroll to Add User to Database
  2. Select your user and database from the dropdowns
  3. Click Add
  4. Tick All Privileges
  5. Click Make Changes

This step is essential — without it, your website will not be able to connect to the database.


Step 5: Using Your Database

You will now need the following details to connect your website or application:

  • Database Name: cpuser_mydb
  • Database Username: cpuser_user
  • Password: (your chosen password)
  • Database Host: localhost

These details are typically entered during installation of applications like WordPress via Softaculous or manual setup.


Managing Your Database with phpMyAdmin

You can manage your database content using phpMyAdmin:

  1. Go back to cPanel
  2. Click phpMyAdmin under the Databases section
  3. Select your database from the left-hand menu

From here, you can:

  • View and edit tables
  • Import or export databases
  • Run SQL queries

Importing a Database (e.g. Migrating a Website)

  1. Open phpMyAdmin
  2. Select your database
  3. Click the Import tab
  4. Choose your .sql file
  5. Click Go

This is commonly used when moving a website from another hosting provider.


Exporting a Database (Creating a Backup)

  1. Open phpMyAdmin
  2. Select your database
  3. Click the Export tab
  4. Choose Quick method
  5. Click Go

Common Issues & Troubleshooting

Error: "Error Establishing a Database Connection"
  • Check database name, username, and password
  • Ensure the user is assigned to the database
  • Confirm database host is localhost
Access Denied for User
  • Reassign the user to the database
  • Ensure All Privileges are selected
Website Migration Issues
  • Ensure database is fully imported
  • Update configuration files (e.g. wp-config.php)

Need Help?

If you're unsure about any step or your website isn't connecting correctly, please contact our support team via your client area. We're happy to help.

  • 11 Users Found This Useful
Was this answer helpful?

Related Articles

Where do I upload my website files?

Your account has both non-web accessible space and of course your web accessible space. Your user...

What are some account basics?

We'll explain some basic procedures and steps to use your account. Username and Passwords:...

How can I download a backup of my site?

Please login to your control panel and create a full backup. This may take a few minutes to...

How do I access cPanel?

You can access cPanel either by going into your client area, selecting your hosting account, and...