Creating MySQL Databases and Users

In this article, we'll cover the steps needed for successfully creating a new database and a new user, that will be assigned to it. This is only usually required for setting up a script or application from scratch, if possible we'd suggest using the Softaculous Auto-Installers where possible which will set up an application like WordPress, Joomla, Magento etc for you.

Starting off first, you would need to login into your cPanel account and from there on, navigate to the "Databases" tab and look for "MySQL Database Wizard".

840

Once you have accessed this tool, you will go through a few steps, the first of which being the creation of the database and more specifically, the name of the database. The database name will be prefixed with your cPanel username, e.g. cpaneluser_dbname. It's best to use something descriptive to avoid confusion later down the line, so something like 'wp' or 'wordpress' are better than just using 'db' for example.

On the following page, you will be asked what should your database username be, along with the password. It is often easiest to create the database user with the same username as the database name. For the password, you can set a password of your choice or use the built-in "Password Generator". Once you're ready with the above, click the "Create User" button, that will lead you into the next bit.

The last step, is for assigning the user, you just created to the database and it almost all cases, all of the Privileges will be needed for the user, therefore, simply tick the box, next to "All Privileges". Once done, click on the "Next Step" button.