Skip to main content
phpMyAdmin Guide
CHAPTER 16 Beginner

How to use phpMyAdmin on Shared Hosting | cPanel & Hostinger

Updated: May 16, 2026
15 min read

# CHAPTER 16

Managing Databases on Shared Hosting

1. Introduction

If you are a freelance web developer building WordPress sites for clients, you likely aren't managing complex Linux servers. You are using Shared Hosting (like Hostinger, Bluehost, or cPanel). In a Shared Hosting environment, you do not have root access to the server. The hosting company heavily restricts your power to prevent you from crashing the machine for other customers. Because of this, the workflow for creating databases and accessing phpMyAdmin is entirely different than XAMPP. In this chapter, we will master the Shared Hosting workflow.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Understand the restrictions of Shared Hosting environments.
  • Create databases and users using the cPanel/hPanel GUI.
  • Connect restricted users to specific databases.
  • Launch phpMyAdmin from a hosting dashboard.
  • Understand database prefix naming conventions.

3. The Shared Hosting Restriction

In XAMPP, you opened phpMyAdmin, clicked "New," and typed a database name. If you click "New" in a Shared Hosting phpMyAdmin, you will get a red error: #1044 - Access denied for user. Why? Because on a shared server with 500 other customers, the hosting company physically blocks you from executing CREATE DATABASE commands inside phpMyAdmin. You MUST use their specific Hosting Control Panel to create databases.

4. Workflow 1: cPanel Database Creation

If your host uses standard cPanel (GoDaddy, Bluehost):
  1. 1. Log into your cPanel dashboard.
  1. 2. Scroll to the "Databases" section. Do NOT click phpMyAdmin yet.
  1. 3. Click the MySQL Databases icon.
  1. 4. Create Database: Type a name (e.g., shop). Notice cPanel forces a prefix on the name based on your username (e.g., client99shop). Click Create.
  1. 5. Create User: Scroll down to Add New User. Type a username (client99admin) and generate a secure password.
  1. 6. The Critical Step (Linking): Scroll to "Add User To Database." Select your new user and your new database from the dropdowns and click Add.
  1. 7. A page appears asking for privileges. Check All Privileges and save.

*Only after completing these 7 steps can you go back to the cPanel homepage and click the phpMyAdmin icon!*

5. Workflow 2: Hostinger (hPanel)

Hostinger uses a custom dashboard, but the logic is identical.
  1. 1. Log into Hostinger. Go to Websites -> Manage.
  1. 2. In the left sidebar, click Databases -> Management.
  1. 3. You will see a combined form. It asks for Database Name, MySQL Username, and Password all in one place!
  1. 4. Fill it out and click Create.
  1. 5. The database instantly appears in a list below. Next to the database name, click the button that says Enter phpMyAdmin.

6. The Forced Prefix Rule

When writing PHP code to connect to your database on XAMPP, your database name was companydb. On Shared Hosting, your login username is usually prefixed to prevent name collisions with other customers on the same server. If your cPanel username is techguru, your database name mathematically becomes techgurucompanydb. If you forget the prefix in your backend PHP configuration file, your website will fail to connect!

7. Remote Database Connections

What if you want to connect a desktop application (like MySQL Workbench) directly to your Shared Hosting database? By default, Shared Hosts block all external IP addresses for security (IP Whitelisting).
  1. 1. Go to cPanel.
  1. 2. Click Remote MySQL.
  1. 3. In the "Add Access Host" box, type your personal computer's current IP address (or % to allow all, though highly discouraged).
  1. 4. Click Add. Your desktop application can now securely tunnel into the shared server.

8. Mini Project: The WordPress Migration

Scenario: Moving a WordPress site from XAMPP to Hostinger.
  1. 1. XAMPP: Open phpMyAdmin, Export wpdatabase.sql.
  1. 2. Hostinger: Go to Databases -> Management. Create user99wpdatabase and user user99admin with password Secret123!.
  1. 3. Hostinger: Click "Enter phpMyAdmin."
  1. 4. phpMyAdmin: Ensure user99wpdatabase is selected in the left sidebar. Click the Import tab. Upload wpdatabase.sql and click Go.
  1. 5. FTP: Edit your wp-config.php file, updating the DBNAME, DBUSER, and DBPASSWORD to match the new cPanel credentials! The site is live.

9. Common Mistakes

  • Forgetting the Link Step: In standard cPanel, creating the Database and creating the User are two separate actions. The most common beginner mistake is creating both, but forgetting step 6 (Linking them together). If you don't explicitly link the user to the database and assign privileges, the user cannot see the database in phpMyAdmin, and your PHP application cannot connect.

10. Best Practices

  • Use the Wizard: cPanel offers an icon called "MySQL Database Wizard". Always use this. It guides you through creating the database, creating the user, and linking them together in a foolproof, 3-step linear process, preventing you from forgetting the crucial linking step.

11. Exercises

  1. 1. Why does clicking the "New" database button inside phpMyAdmin fail in a Shared Hosting environment?
  1. 2. What forced naming convention do Shared Hosts apply to your database names to prevent conflicts with other customers?

12. Database Challenges

You successfully imported your database into cPanel. You updated your PHP backend code with the correct password, but the website throws a "Database Connection Failed" error. Upon inspecting your PHP code, you see: $db
name = "storedatabase";. Your cPanel login username is johnsmith. What architectural mistake caused the failure? *(Answer: You forgot the forced prefix. In a shared hosting environment, the database name must include the cPanel username prefix. The PHP code must be updated to $dbname = "johnsmithstoredatabase";).*

13. MCQ Quiz with Answers

Question 1

In a standard cPanel Shared Hosting environment, what is the mandatory workflow to deploy a database and access it in phpMyAdmin?

Question 2

By default, attempting to connect a desktop application (like MySQL Workbench or DBeaver) to a Shared Hosting database over the internet will fail. What specific cPanel security feature must be configured to allow this connection?

14. Interview Questions

  • Q: Explain the architectural separation of concerns between cPanel (or hPanel) and phpMyAdmin in a Shared Hosting environment. Why is user and database creation stripped away from phpMyAdmin in these specific ecosystems?
  • Q: Detail the complete, end-to-end migration process of moving a PHP/MySQL web application from a local XAMPP environment to a live cPanel hosting provider.

15. FAQs

Q: My host doesn't use cPanel or Hostinger; they use something called Plesk. Does this still apply? A: Yes! Plesk, DirectAdmin, and almost all other shared hosting control panels follow this exact same logic. Create the DB in the panel, create the User in the panel, link them, and then launch phpMyAdmin.

16. Summary

You are now capable of navigating the professional hosting landscape. By understanding the strict limitations of shared servers, mastering the cPanel Database Wizard, accommodating forced prefixes, and unlocking Remote MySQL, you can confidently launch web applications for freelance clients worldwide.

17. Next Chapter Recommendation

The database is built, secured, and live on the internet. Now, we must actually connect our website to it! In Chapter 17: Connecting PHP Applications with MySQL, we will leave the phpMyAdmin dashboard and write the backend PHP code required to communicate with our database.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·