Create & Test MySQL Database

Creating the Database

When you create a database on your web hosting account, you will create your database using the MySQL Database management tool on your web host's control panel.

I don't know of any web hosts that will allow you to create databases from PHP scripts.

Note: If you have accessed this web page via a search engine, you should go back and start at the Beginning.
This tutorial is designed to be viewed and executed in sequence.
Learn to build your database right on your PC and Export it to your website.


If you are going to test the scripts on the IndigoAMPP server with HTMLPad, we'll run through the process of creating your database from the PHPMyAdmin panel on IndigoAMPP.

IndigoAMPP Users

Start the IndigoAMPP server and open HTMLPad 2014.

There are 2 ways to access PHPMyAdmin

1...With HTMLPad 2014:
Click File - Open
Navigate to C:\indigoampp\apache-2.2.15\htdocs\phpmyadmin\scripts

Find the script named signon.php and load it into the editor window

Click Preview

IndigoAMPP #1


Since IndigoAMPP is configured to accept the user named root without a password on localhost, enter those values as shown and click Submit Query.

If the server is running and you've set Preview -Mappings for the htdocs folder (HTMLPad 2014 users), you'll go right into the PHPMyAdmin panel.

2...With your browser:
Make sure the IndigoAMPP server is turned on
In the top of your browser type: http://localhost/
Hit Enter
In the Index of files find: phpMyAdmin/ and click.

IndigoAMPP #2


Note: If you use the second method, you can leave the PHPMYAdmin panel open and view your changes as you run through the lessons. You will make a change, then Refresh the browser.

To Create the Database

To create the database named newdb that we'll use in this tutorial, find the box shown here:

IndigoAMPP #3


Enter: newdb and click Create

That's it. You are ready to start running scripts that add Tables and Insert data into your database.

Note: You don't need to open and close the PHPMyAdmin panel.
If you leave it open and don't see changes like tables added, refresh the browser and your changes will show.

Now let's run a script to add a table to the new database.

Proceed to: Create a Table

MySQL Tutorial

To extend your knowledge of MySQL study the Docs and Tutorials at the official MySQL website.