Most website software, including WordPress, Joomla and online shops, stores its content in a database. If you're installing something by hand (rather than with Softaculous or WP Toolkit, which do this for you), you'll need to create a database and a user that can access it.

Our servers run MariaDB, which is a drop-in replacement for MySQL, so anything that asks for MySQL will work.

The quick way: MySQL Database Wizard

  1. Log in to cPanel from your service page under Services → My Services (https://www.hooplahosting.co.nz/client/clientarea.php?action=services).
  2. Open MySQL Database Wizard (type it in the cPanel search bar).
  3. Step 1: enter a name for the database, for example shop, and click Next Step.
  4. Step 2: enter a username, for example shopuser. Click Password Generator to create a strong password, copy it somewhere safe, then click Create User.
  5. Step 3: tick ALL PRIVILEGES and click Next Step.

That's it. The database and user are created and linked.

Your database details

cPanel adds your cPanel username to the front of every database and user name. If your cPanel username is hoopla, the examples above become:

  • Database name: hoopla_shop
  • Database user: hoopla_shopuser
  • Password: the one you generated
  • Database host: localhost
  • Port: 3306 (the default, so you usually don't need to enter it)

Use the full names, including the prefix, when your software asks for them. For WordPress, these go in wp-config.php as DB_NAME, DB_USER, DB_PASSWORD and DB_HOST.

Managing databases later

Open Manage My Databases (called MySQL Databases on some versions of cPanel). From there you can:

  • Change a user's password: under Current Users, click Change Password next to the user. Remember to update your website's config file with the new password, or the site will show a database connection error.
  • Add an existing user to another database: under Add User To Database, choose the user and database, click Add, then tick ALL PRIVILEGES.
  • Delete a database: click Delete next to it. This can't be undone, so export a copy first with phpMyAdmin.
  • Repair a database: under Modify Databases, choose the database and click Repair Database if your site reports crashed tables.

To look inside a database, or import and export it, use phpMyAdmin in cPanel. See Import and export a database with phpMyAdmin.

Connecting from your own computer

Databases only accept connections from the server itself by default, which is the safest setup. If you need to connect from a desktop tool such as HeidiSQL or MySQL Workbench, open Remote Database Access in cPanel and add your own public IP address. Remove it again when you've finished. Use your domain name as the host and port 3306.

Troubleshooting

  • "Error establishing a database connection": the database name, username or password in your config file doesn't match. Check you've used the full prefixed names, and reset the user's password if you're not sure what it is.
  • "Access denied for user": the user hasn't been added to the database. Add it under Add User To Database with ALL PRIVILEGES.
  • "max_user_connections" errors: see Error: User has exceeded the 'max_user_connections' resource.
  • Which version are you running? See Which MariaDB (MySQL) version do you use?

Need help?

If you get stuck, open a support ticket and we'll help.

Was this answer helpful? 0 Users Found This Useful (0 Votes)