Web Hosting #Database #MySQL #phpMyAdmin

Creating and Managing MySQL Databases with phpMyAdmin

7 min read · -136 views · Updated Jun 02, 2026

Almost every web application — from WordPress to Joomla to custom PHP projects — needs a MySQL database to store its content, settings, and user data. This guide walks you through creating a database and database user in cPanel, assigning the correct privileges, finding your connection details, and using phpMyAdmin to manage your data on Momo Cloud shared hosting.

Why You Need a MySQL Database

When you install an application like WordPress, it needs three things before it can run: a database (where all your posts, pages, and settings are stored), a database user (an account with a password that the app uses to connect), and that user must be assigned to the database with the right permissions. Without all three steps completed, you will see errors like "Error establishing a database connection" on your site.

Important: cPanel Username Prefix

Tip: cPanel automatically adds your hosting account username as a prefix to all database and database user names. For example, if your cPanel username is momouser and you create a database called mysite, the actual database name will be momouser_mysite. Always use the full prefixed name when configuring your application.

Method 1: MySQL Database Wizard (Recommended for Beginners)

The MySQL Database Wizard guides you through all three required steps — creating the database, creating the user, and assigning the user — in one simple flow. This is the easiest way to get started.

  1. Log in to your Momo Cloud cPanel account.
  2. In the Databases section, click MySQL Database Wizard.
  3. Step 1 — Create a Database: Enter a name for your database (for example, wordpress) and click Next Step. cPanel will create the database and show you the full name with your prefix (e.g., momouser_wordpress).
  4. Step 2 — Create Database Users: Enter a username (e.g., wpuser) and a strong password. You can use the Password Generator to create a secure password — copy it somewhere safe before continuing. Click Create User.
  5. Step 3 — Add User to the Database: Check the box for ALL PRIVILEGES and click Next Step. This grants the user full control over the database, which is required by most applications.
  6. You will see a confirmation screen. Your database, user, and privileges are now set up and ready to use.

Method 2: MySQL Databases (Manual Method)

If you prefer more control, or need to manage existing databases and users, use the MySQL Databases tool in cPanel.

Creating a Database

  1. In cPanel, go to Databases > MySQL Databases.
  2. Under Create New Database, enter a database name and click Create Database.
  3. cPanel confirms creation and shows the full database name including your prefix.

Creating a Database User

  1. Scroll down to the MySQL Users section.
  2. Enter a username and a strong password, then click Create User.
  3. Note the full username shown (it will include your cPanel prefix, e.g., momouser_wpuser).

Assigning a User to a Database

  1. Scroll down to Add User to Database.
  2. Select the user and the database from the dropdown menus, then click Add.
  3. On the privileges screen, click ALL PRIVILEGES to check all boxes, then click Make Changes.

Tip: Skipping the "Add User to Database" step is the most common reason apps show a database connection error even when the database and user exist. Always complete all three steps.

Finding Your Database Connection Details

Once your database and user are ready, you will need four pieces of information to configure your application. For most Momo Cloud shared hosting accounts, the hostname is localhost.

Setting Where to Find It Example Value
Database Host Almost always localhost on shared hosting localhost
Database Name Shown in cPanel MySQL Databases (with prefix) momouser_wordpress
Database User Shown in cPanel MySQL Databases under MySQL Users momouser_wpuser
Database Password The password you set when creating the user (your chosen password)

For WordPress, you enter these details during the installation wizard, or edit them directly in wp-config.php:

define( 'DB_NAME',     'momouser_wordpress' );
define( 'DB_USER',     'momouser_wpuser' );
define( 'DB_PASSWORD', 'YourStrongPassword' );
define( 'DB_HOST',     'localhost' );

Using phpMyAdmin

phpMyAdmin is a browser-based tool that lets you view and manage your database without writing SQL commands. You can access it from cPanel under Databases > phpMyAdmin.

Browsing Tables

  1. Open phpMyAdmin from cPanel.
  2. In the left panel, click your database name to expand it.
  3. Click any table name (for example, wp_posts) to browse its rows in the right panel.
  4. Use the Search tab on any table to filter rows, or click a row's Edit link to modify a value directly.

Running a SQL Query

  1. Select your database in the left panel.
  2. Click the SQL tab at the top.
  3. Type or paste your query in the text box, for example:
SELECT * FROM wp_users WHERE user_email = 'you@example.com';
  1. Click Go to run the query. Results appear in a table below.

Tip: Always back up your database before running UPDATE or DELETE queries. A single wrong query without a WHERE clause can affect every row in a table.

Exporting a Database (Backup)

  1. Select your database in the left panel of phpMyAdmin.
  2. Click the Export tab.
  3. Choose Quick export method and leave the format as SQL.
  4. Click Go. Your browser will download a .sql file — store this somewhere safe as your backup.

Importing a Database (Restore)

  1. Select your database in the left panel (create a new empty database first if needed).
  2. Click the Import tab.
  3. Click Choose File and select your .sql or .sql.gz file.
  4. Click Go to begin the import.

Tip: phpMyAdmin has a default upload size limit (usually 50–128 MB). For larger databases, compress your file to .sql.gz format first — phpMyAdmin can import compressed files directly and this significantly reduces file size. For very large databases, contact Momo Cloud support for an assisted restore.

Changing a Database User's Password

  1. In cPanel, go to Databases > MySQL Databases.
  2. Scroll to the Current Users list and click Change Password next to the user you want to update.
  3. Enter and confirm the new password, then click Change Password.
  4. Update the new password in your application's configuration file (e.g., wp-config.php) immediately, otherwise your site will lose its database connection.

Troubleshooting Common Database Issues

"Error Establishing a Database Connection"

This is the most common WordPress database error. Check the following in order:

  • Wrong database name or username — make sure you are using the full prefixed names (e.g., momouser_wordpress), not just the short name you typed during creation.
  • Wrong password — verify the password in wp-config.php matches exactly what you set in cPanel. Passwords are case-sensitive.
  • User not added to the database — go back to cPanel MySQL Databases and confirm the user appears under the database in the Current Databases list. If not, add the user and grant ALL PRIVILEGES again.
  • Wrong host — the host should be localhost for Momo Cloud shared hosting. Only change this if support specifically tells you otherwise.

"Access Denied for User" Error

This means the database user exists but does not have the right permissions on that database. Go to cPanel, remove and re-add the user to the database with ALL PRIVILEGES selected, then try again.

Import File Too Large

If phpMyAdmin rejects your import file because it exceeds the size limit, compress your .sql file to .sql.gz using a tool like 7-Zip or the terminal command gzip database.sql. phpMyAdmin accepts compressed files and they are typically 80–90% smaller. For imports over several hundred megabytes, open a support ticket with Momo Cloud for a command-line assisted import.

With your database created, your user assigned, and your connection details in place, your application has everything it needs to run. Keep regular exports of your database using phpMyAdmin as a simple backup routine, and reach out to Momo Cloud support any time you need a hand with database management.

Was this article helpful?

#Database #MySQL #phpMyAdmin
Share