If you run across a PHP/MySQL-driven script that you want to install, you’ll need to know how to set up a MySQL database. In this tutorial, I take you step by step through the process. Please note that this tutorial assumes that you use Cpanel to access the functions necessary to set up a MySQL database.
Without further ado…
1) Navigate to the Databases section in Cpanel. It will look something like this:
2) On the page that comes up, you’ll want to navigate to the area labeled ‘Create a New Database.’ It’ll look something like this:
Note: I’ve sanitized the pictures used in this tutorial so that they’re not giving away sensitive account information. So, in your case, instead of seeing a ‘l_’ prefix, you’ll likely see your account username before the underscore.
3) After clicking ‘Create Database’, you’ll see this screen:
4) So, so far, we’ve set up our database. We’re not done, though. We need to create a user that can access the database and give that user rights to access/modify it. To that purpose, we scroll down to the ‘MySQL Users’ section where it says ‘Add a New Uswer.’ That’ll look like this:
For your password, include lowercase & uppercase letters, make the password at least several characters long, and it sure doesn’t hurt to use a special character like ‘!’ in it. (There are websites out there that’ll help you generate a strong password.) Make sure to record the database name you made earlier, this username, and the password you just made in a safe location for future reference. Once finished, click ‘Create a User.’
5) Similar to prior steps, doing so brings up this page:
6) Now we want to assign the user we just made to the database we made. To do so, navigate to the section on the Databases page labeled ‘Add a User to a Database’. It’ll look something like this:
7) After clicking ‘Add’, the following page shows up:
That’s it. You now have a MySQL database set up! You’ll need to propagate it with tables and data but most scripts either provide you with an installation page that does it for you or an SQL schema you can run to populate your database with what it needs to run. I’ll cover manually running SQL schemas in PHPMyAdmin in the future. Hope this helped!