How to Create a Database with phpMyAdmin
Creating databases is the most important step in web development. And phpMyAdmin makes it easier than ever before. This tutorial will teach you how to create a database with phpMyAdmin.
The phpMyAdmin is a free tool for MySQL database administration. It allows us to easily create, manage, and manipulate MySQL databases. And it’s easier than you think. So, let’s begin.
How to Create a Database with phpMyAdmin
To demonstrate things we’ll use localhost instead of a live server. However, the exact same steps are applied to the live server. We’ll walk you through the following steps to create a database with phpMyAdmin. By clicking, you can jump on any of these four steps given below.
- Download and Install XAMPP on Your PC.
- Run Apache and MySQL servers in XAMPP.
- Access phpMyAdmin in your Browser.
- Create a MySQL Database with phpMyAdmin.
Note: If you have a web hosting server and phpMyAdmin is available there. Then, you can start from step #4 directly to create a database. But for beginners, it is recommended to do this on localhost for practice.
Let’s create a database with phpMyAdmin.
Step #1: Download and Install XAMPP on Your PC
XAMPP is an open-source web server software. It allows us to set a local web server environment on our local computer. In simple words, you can create a local web server on your PC using XAMPP. With the help of XAMPP, you can do any backend web development work on your PC without buying a live server.
It is available in different operating systems for free. You can download it from their official website Apachefriends.org.
After downloading XAMPP on your pc, install XAMPP, open it and then see the next step.
Step #2: Run Apache and MySQL servers in XAMPP
After installation of XAMPP, open it on your PC. Then, run Apache and MySQL servers in XAMPP as shown in the image below.
Apache is a web server while MySQL is our database server where we’ll create a database with phpMyAdmin.
Now, Apache and MySQL servers are running. Don’t close XAMPP, just minimize it and see the third step. Now, we’re ready to access phpMyAdmin on our local computer. Let’s see how to do that in step #3.
Tip: You can also learn about creating databases using PHP code.
Step #3: Open phpMyAdmin in Your Browser
To do this, just open your browser and type
localhost/phpmyadmin in your browser as shown in the image below.
It will take you to phpMyAdmin where you’ll create a database.
After that, go ahead to the next step.
Step #4: Creating a Database with phpMyAdmin
Now to create a database with phpMyAdmin, click on the New button given on the left side as shown in the image below. This will take you to the page where you’ll give a name to your MySQL database.
Now, give your database a name. I gave it
form_entriesdb a name that is pretty informative. You can also use underscores ‘_’ in the database name.
No need to worry about the second input field. Just click on create button to create a new database as shown in the image above.
Note: Give your database a unique name, do not copy.
Now, the database has been created as you can see in the following image.
On the left side, all of your databases will be listed. No matter how many databases you create with phpMyAdmin, all of those will be listed on the left side.
You can also create a database using SQL queries. To do this, just go to the SQL section of phpMyAdmin as shown in the image below. Then, type
create database form_entriesdb; and click the Go button.
Done! This is also an easy way to create a database with phpMyAdmin. But it requires some knowledge of SQL.
Now you know how to create a database with phpMyAdmin.
Next, you should learn about how to create tables in the database. Also, knowing how to import and export databases is extremely beneficial because you can manage the backups by yourself. In this tutorial about How to import and export databases using phpMyAdmin, you can learn more.
That’s all. Hope this tutorial will be helpful and easy to understand.
Finally, if you’ve any questions related to this tutorial then feel free to ask in the comments section below.
Also read: How to Connect HTML form to Database using PHP.