How to Create a MySQL Database in cPanel
Creating a MySQL database in cPanel is essential for web applications that require data storage, such as WordPress, Joomla, or custom applications. This guide will walk you through the steps to create a MySQL database in cPanel.
Prerequisites
- Access to your cPanel account.
- A basic understanding of databases.
Step 1: Login to cPanel
Step 2: Locate the MySQL Databases Section
- Once logged in, scroll down to the Databases section.
- Click on MySQL Databases.
Step 3: Create a New Database
- In the Create New Database section, enter a name for your database in the text field.
- Note: Database names often begin with your cPanel username, followed by an underscore (e.g.,
username_dbname
).
- Note: Database names often begin with your cPanel username, followed by an underscore (e.g.,
- Click Create Database.
- You should see a success message indicating that your database has been created.
Step 4: Create a Database User
- Scroll down to the MySQL Users section.
- In the Add New User field, enter a username.
- Choose a strong password and enter it in the Password and Password (Again) fields.
- Alternatively, you can use the Password Generator to create a secure password.
- Click Create User.
- A success message will confirm that the user has been created.
Step 5: Add User to Database
- Scroll down to the Add User to Database section.
- Select the user you just created from the User dropdown menu.
- Select the database you created from the Database dropdown menu.
- Click Add.
- On the next screen, you’ll need to set the user privileges.
- You can select All Privileges to give the user full access to the database or choose specific privileges as needed.
- Click Make Changes.
Step 6: Confirm Your Setup
- After completing these steps, your MySQL database and user are now set up. You can view them in the Current Databases section, where you will see a list of all your databases and their associated users.
Step 7: Use Your Database
- You can now use your MySQL database with your web applications by connecting using the database name, username, and password you just created.