Intro to cPanel MySQL Databases
Each database you use on your account needs to have a distinct name. Each database you connect to needs a database username assigned to the database so your scripts/website can connect to it. For this document, we'll assume you have the domain name example.com, and your cPanel login/username is example.Create a New Database
- Login to cPanel using the URL: http://example.com/cpanel
- Click MySQL Databases
- On the next screen, scroll to and click Current Databases
- Click New Database
- Type in the database name (let's call it 'mydb') in the empty text field and click Create Database
Create a Database User
Each database needs a username to allow connections. To create a database user:- Log into your cPanel account
- Click MySQL Databases and scroll down to Current Users
- Look for username and password fields
- Type in a username and password
Note: we'll assume you are using 'dbuser' with password 'user123' - Click Create User
User: example_dpuser
Pass: user123
Add User to Database
Finally, you need to associate the new username with the database. To do so:- Scroll down to and click Add Users to Your Databases
- Select 'example_dbuser' from the dropdown menu on the left and the database 'example_mydb' from the dropdown menu on the right
- Click Add User to Database
server: localhost
database: example_mydb
database user: example_dbuser
database password: user123
Check out how to connect to a MySQL database, import OR merge databases and more in our MySQL section.