Create MySQL database in cPanel
Why create a database in cPanel?
MySQL databases are essential for web applications like WordPress, Joomla, PrestaShop and many others. cPanel offers a simple graphical interface to create and manage databases without needing to use the command line.
Steps to create a MySQL database
1. Access cPanel
- Go to your cPanel panel (usually
https://yourdomain.com:2083orhttps://yourdomain.com/cpanel) - Log in with your credentials
2. Go to "MySQL Databases" section
On the cPanel main page, look for the "Databases" section and click on "MySQL Databases".
You can also search for it using the search box at the top of cPanel.
3. Create the database
In the "Create New Database" section:
- Enter a name for your database (for example:
myweb_db) - Click "Create Database"
Note: cPanel will automatically add a prefix to your database name (usually your cPanel username). For example, if your user is user1 and you create myweb_db, the actual database will be user1_myweb_db.
4. Create a user for the database
In the "MySQL Users" section:
- Enter a username (for example:
myweb_user) - Enter a secure password (or use cPanel's password generator)
- Click "Create User"
Important: Save the complete username and password, as you'll need them to connect your application to the database.
5. Assign user to database
In the "Add User To Database" section:
- Select the user you created from the user dropdown menu
- Select the database from the database dropdown menu
- Click "Add"
6. Grant privileges
After adding the user, a page will open where you can select privileges:
- ALL PRIVILEGES: Grants all permissions (recommended for most applications)
- SELECT, INSERT, UPDATE, DELETE: Basic permissions to read and write
- Other specific privileges: You can select individual permissions according to your needs
For most web applications (WordPress, Joomla, etc.), select "ALL PRIVILEGES" and click "Make Changes".
Verify creation
After completing the steps, you should see:
- Your database listed in "Current Databases"
- Your user listed in "Current Users"
- The user-database relationship in "Current Users With Access To Databases"
Important information for connection
To connect your application to the database, you need:
- Server name/Host: Usually
localhostor the server IP - Database name: The complete name with prefix (e.g.,
user1_myweb_db) - Username: The complete name with prefix (e.g.,
user1_myweb_user) - Password: The one you configured
- Port: Usually
3306(MySQL default port)
Access phpMyAdmin
To manage your database visually, you can use phpMyAdmin:
- In cPanel, search for "phpMyAdmin" in the databases section
- Click to open phpMyAdmin
- Select your database from the side menu
- From there you can create tables, import data, run SQL queries, etc.
Delete a database
If you need to delete a database:
- In the "Current Databases" section, find the database
- Click "Delete"
- Confirm deletion
Warning: Deleting a database permanently deletes all data. Make sure you have a backup before deleting.
Common problems
Error: "Database name already exists"
- The database name is already in use. Choose another name.
Error: "Username already exists"
- The username is already in use. Choose another name.
Can't connect from my application
- Verify you're using the complete name with prefix
- Verify the password is correct
- Verify the user has necessary privileges
- Verify the host is correct (usually
localhost)
Tips
- Use descriptive names: Choose names that indicate what the database is for
- Use secure passwords: Use cPanel's password generator or create a strong password
- Save information: Write down all connection data in a safe place
- Limit privileges: Only grant necessary privileges for your application
- Make backups: Set up automatic backups of your databases
Need help?
If you're having trouble creating or managing databases in cPanel, open a ticket from the billing.baires.host panel or contact us for support.
You can also reach us through our social media:
- Instagram: @baires_host
- Discord (active support): https://discord.gg/dzjauatAFN
- Linktree: https://linktr.ee/baires.host