How to create a database and table in phpMyAdmin

This is a beginner tutorial of MySQL which shows you how to create a MySQL database and a table in phpMyAdmin step by step with images.

As you are a beginner in learning PHP programming you should have been downloaded XAMPP or WAMPP and installed in your system.

There are two ways you can create a database:

1. from command prompt
2. from phpMyAdmin.

the 2nd one is the easiest way to create a database and a table where you don’t need to worry about the SQL Queries.

Lets begin,

To open the phpMyAdmin, use the below URL  in your Browser’s address bar (only in local computer):

You will see the below screen:

phpmyadmin-home
Sometimes you may see a Login form asking for username and password if you set it already, just give them and you will see this above screen.

The green square shown in the above image is the list of databases which is already present in the server. To create a new database click the ‘datatbase‘ button.

Once you click the ‘Database’ button you will reach to this page:

phpmyadmin-create-database
Now, see the text box marked in green where you have to give the new database name and click ‘create‘ button. In the above image i have given ‘mynewdatabase’.

phpmyadmin-created-database
After you hit the ‘create’ button the database will be created within a second and a message will appear saying ‘Database yourdbname is created’ and also you can see the database at the left side navigation frame (marked in green).

That’s it, you have created the database successfully, really easy isn’t it?. Now, lets see how you can create a table in your new database.


Creating a Table in phpMyAdmin
:

It is same as creating a database like above shown,  just need to click the buttons only, no need to write a single query at all.

To create a table, just click the database that you have created just now which is being shown in the left navigation frame, after you click the database you will see the options to create the table as shown in the below image:

phpmyadmin-create-table
I think now you can do it easily, because it is same like creating the database but the only difference is, you have to give the number of rows in this, so give the table name and number of rows and click the button ‘Go‘ as shown in the above image.

After you click the go button, this is the screen you will see:

phpmyadmin-table-rows

 

Now, give the row name, datatype and click ‘Save’ button. That’s it you have a table now in your database.

phpmyadmin-table-created

You can see the table at the left navigation frame also in the page as shown above. I hope this tutorial is helped you in creating the database and a table in phpMyAdmin. Keep learning and be happy!

 

Related Posts

Leave a Reply