How to create a new MySQL database in cPanel at Hostinger

Creating a new MySQL database at Hostinger using cPanel

Updated 3 weeks ago

Create a new MySQL database in cPanel to store data for your website.

Create the database

You can easily create a new MySQL database by opening your cPanel and clicking on MySQL Databases section:

cPanel Databases section with MySQL Databases option highlighted

Once there, enter the database name and click on Create Database:

cPanel Create New Database page with Create Database button highlighted

By default, the prefix will be your cPanel username followed by an underscore. eg. user_

Select to Go Back after creating the database and scroll down to the Add New User section, taking the following into consideration:

  • The username name will have the same prefix as the database

  • Enter the database password twice. The password must be a minimum of 10 characters long; otherwise the database connection will fail. It is recommended to use the password generator tool to ensure a strong password is used, as it generates passwords that already meet this minimum length

Next, click on Create User:

cPanel Add New User form with the Create User button highlighted

Finally, on the Add User To Database section right below, connect your newly created user with the database. Select the user and database from the dropdownl ist and click on Add:

Hostinger cPanel dialog to add a user to a database, with the Add button highlighted

That’s it! Your MySQL database will be created with a user correctly associated with it.

If you are experiencing a “database connection failed” error, this is likely because the database password is shorter than 10 characters. Change the password to one with a minimum of 10 characters to resolve this.

Related database tasks