If you followed my tutorial on making a MySQL database in Cpanel, you may have noticed at the end of that tutorial that I talked about populating your database with tables and data. Oftentimes, when you’re installing a script, the developer of the script will either provide you an installation page that does all of the heavy lifting for you OR you’re left to figure out what to do with the sql schema they give you. This tutorial will take you step by step through importing the sql into your database.
If, on the other hand, you missed out on that tutorial and are just trying to figure out how to import your SQL schema into your MySQL database via phpMyAdmin, this tutorial should also help you get that squared away! Please note that this tutorial assumes that you use Cpanel to access phpMyAdmin. If you don’t have Cpanel, then you may have to access phpMyAdmin differently than shown in this tutorial (which sadly is outside the scope of this particular tutorial.)
And with all of that said, let’s get started!
1) If you followed my MySQL database tutorial, then you’ll recognize the following screenie:
2) I have Host Gator webhosting so sometimes this screen will pop up before it actually goes to phpMyAdmin. (Totally normal and usually doesn’t take long.)
3) Next, you will see the main phpMyAdmin page. It’ll look like this (instead of an italicized ‘l’, you should see your account name.)
4) You’ll next see something like this:
Note: My database listings are purposely blurred out for security reasons. In your case, you should see the text for your database listings (if you already have any databases.)
5) Once you click ‘l_testdb’ on the left side of the screen (or whatever database you’re working with), this will show up on the right side:
6) There are two options to import your SQL. You can either import the file itself. To do so, you click on the Import tab which shows you this page:
7) The other option is to manually enter (or copy and paste the SQL.) To do that, click on the SQL tab and you’ll see something like this:
8) Both options should result in a page that looks like this:
9) With that completed, you can now check out the new structure of your database by clicking on the Structure tab. In this example, it ends up looking like this:
When you’re first learning to do stuff like this, it can be a bit intimidating, but it’s really quite easy to do once you know how to do it. I hope that this tutorial helped you. If you have any questions or comments, please leave them in the comment section below.
If you would like to check out my tutorial on how to make a MySQL database in Cpanel, click here!