The XAMPP stack of software is an open-source, localhost-based server that encompasses software packages offering a multitude of functionalities. You can use the XAMPP control panel to start or deactivate all the software that comes with it.
With XAMPP, you can test projects and modifications before releasing them online. The MySQL database forms a vital component of the XAMPP stack, being one of its most significant features. With XAMPP, you can use phpMyAdmin to create & use your XAMPP MySQL database in minutes.
In this article, we have provided you with a comprehensive explanation of what XAMPP is and how to use it to build a XAMPP MySQL database.
Table of Contents
What is XAMPP?
XAMPP is an open-source web server solution stack package developed by Apache Friends. It consists of the Apache HTTP Server, MySQL database, and interpreters for PHP and Perl programming languages.
XAMPP makes it easy to set up a local web server for testing purposes on your own computer, allowing web developers to quickly test their applications during development.
You can download XAMPP using this link.
Switching MySQL databases to a new server can be simple and secure. Hevo’s automated pipeline ensures seamless data transfer with minimal downtime and complete accuracy.
- No-Code Automation: Move data effortlessly, no complex scripts required.
- Incremental Load Options: Transfer only the new changes, saving time and resources.
- Comprehensive Monitoring: Track data migration in real time for a secure process.
Join over 2000 satisfied customers, including companies like Cure.Fit and Pelago, who trust Hevo for their data management needs. Explore our capabilities with a free personalized demo and see how you can benefit.
Get Started with Hevo for FreeWhat is MySQL?
MySQL is an open-source relational database management system based on SQL, which is free and popular for web applications.
MySQL is used by many database-driven web applications, including WordPress, Facebook, Twitter, YouTube, and Google, to provide fast and reliable storage and retrieval of website and app data, such as user profiles, content, statistics, etc.
How to Use XAMPP to Create a MySQL Database?
Here’s how to use XAMPP for MySQL:
- XAMPP MySQL Step 1: Opening XAMPP
- XAMPP MySQL Step 2: Starting XAMPP
- XAMPP MySQL Step 3: Accessing Admin
- XAMPP MySQL Step 4: Creating a Database
- XAMPP MySQL Step 5: Creating a Table
- XAMPP MySQL Step 6: Insert Data
- XAMPP MySQL Step 7: Retrieve Data
- XAMPP MySQL Step 8: Importing SQL File
- XAMPP MySQL Step 9: Export SQL File
Step 1: Opening XAMPP
In this section, we will show you how to open MySQL in XAMPP. Go to your system’s XAMPP folder or simply click the XAMPP Icon to open it. The control panel is now visible, and you may use it to start or stop any module.
Step 2: Starting XAMPP
Select the “Start” option for the Apache and MySQL modules, respectively. The user will see the following screen once it has started working:
Step 3: Accessing Admin
Next, select the MySQL module and click the “Admin” button. The user is immediately redirected to the following address in a web browser:
http://localhost/phpmyadmin
Step 4: Creating a Database
Next, we will learn how to create a database in XAMPP. Setting up an XAMPP database is straightforward, making it convenient for beginners to practice database management. A number of tabs appear, including Database, SQL, User Accounts, Export, Import, Settings, and so on. Select the “Database” tab from the drop-down menu. The “Create” option is visible there. Choose a suitable name for the Database input field.

Step 5: Creating a Table
Let’s construct a table named entries. There are various options for creating a table.
You can utilize the “Create Table” feature.
- On the phpMyAdmin screen, choose the guestbook database.
- Select the “Structure” tab.
- Under “Create Table”, provide a table name and the number of columns.
- Click the “Go” button. This prompts you to input the column information.
You may use the SQL command to create a table.
- On the phpMyAdmin screen, choose the “SQL” tab.
- Enter the following code.
USE guestbook;
CREATE TABLE entries (guestName VARCHAR(255), content VARCHAR(255),
entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID));
If you have already selected the guestbook database (on the left panel), you do not need to include “USE guestbook” in your SQL query.
To run the command, simply click the “Go” button.
Note: You can use the following shortcuts on your keyboard to run commands
- Mac users may hit Control+Enter to run.
- For Windows users, press Control+Enter to run.
Step 6: Insert Data
There are various options for inserting data into a table.
You may utilize the “Insert” feature
- On the phpMyAdmin screen, pick the “guestbook database” and then the entries table.
- Select the “Insert” tab.
- Enter the value for each column for each data record that will be added.
- Click the “Go” button.
You can use the SQL command to insert data.
- On the phpMyAdmin screen, pick the “guestbook” database and then the entries table.
- Select the SQL tab.
- Enter the following code.
INSERT INTO entries (guestName, content) values ("Humpty", "Humpty's here!");
INSERT INTO entries (guestName, content) values ("Dumpty", "Dumpty's here too!");
To run the command, simply click the Go button.
Understand how Data Loading takes place in MySQL with our comprehensive guide.
Step 7: Retrieve Data
There are various ways for retrieving data from a table.
You may utilize the “Browse” option.
- On the phpMyAdmin screen, select the “guestbook” database and then the “entries” table.
- Select the “Browse” tab. This will display all existing records in the table.
You may use the SQL command to get data.
- On the phpMyAdmin screen, pick the “guestbook” database and then the “entries” table.
- Select the “SQL” tab.
- Enter the following code.
SELECT * FROM entries;
To run the command, simply click the “Go” button.
Step 8: Importing SQL File
Create a blank file called “friendbook.sql”. Paste the following text into the file.
CREATE TABLE friends
(friendName VARCHAR(255),
phone VARCHAR(255),
entryID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(entryID));
INSERT INTO friends (friendName, phone) values ("Humpty", "111-111-1111");
INSERT INTO friends (friendName, phone) values ("Dumpty", "222-222-2222");
- On the phpMyAdmin screen, choose the “guestbook” database.
- Select the “Import” tab.
- Choose the .sql file to import.
To run the command, simply click the “Go” button.
Check out our guide on importing data from CSV into MySQL.
Step 9: Export SQL File
- On the phpMyAdmin screen, choose the “guestbook” database.
- Select the “export” tab.
- Click the “Go” button to run the command.
- To run the command, simply click the “Go” button.
XAMPP MySQL – Saving the Database
We must now initialize the columns according to their kind. Fill in the names for each of your columns, as well as the type and the input field’s maximum length. In the bottom-right corner, click “Save.” The table has been constructed with the initialized columns. Your Database can have as many tables as you like.

XAMPP MySQL – Use Cases
- Developing and testing web applications: XAMPP provides a local development environment that includes an Apache web server, a MySQL database server, and interpreters for PHP and Perl. This allows developers to create and test web applications on their local machines without needing to deploy them to a remote server.
- Content management systems (CMS): Many popular content management systems (CMS), such as WordPress, Joomla, and Drupal, use MySQL databases to store their content. XAMPP can be used to develop and test these CMS locally before deploying them to a live server.
- E-commerce applications: Utilize MySQL databases to store product information, customer data, and order details. XAMPP can be used to develop and test these applications locally before deploying them to a production environment.
Conclusion
In this guide, we’ve shown you how MySQL plays a crucial role in web development and why XAMPP MySQL can act as the backbone of any successful project. With the need for thorough testing and a secure, fully equipped environment, XAMPP provides everything developers need to build, test, and run their applications smoothly.
Managing the growth of databases and the increasing number of linked procedures, such as business analytics, is a challenging task. Migrating large volumes of data from MySQL to a cloud-based data warehouse is a time-consuming and inefficient operation. Still, with a data integration tool such as Hevo you can do it in no time and with no code.
Sign up for a 14-day free trial and simplify your data integration process. Check out the pricing details to understand which plan fulfills all your business needs.
Share your experience of how to use XAMPP MySQL Database in the comments section below!
FAQs
1. How to Use MySQL on XAMPP?
Start MySQL from the XAMPP Control Panel, then access phpMyAdmin to manage databases. You can also connect applications using root
as the default user or access MySQL via the command line.
2. Do I Need MySQL if I Have XAMPP?
Yes, XAMPP includes MySQL as part of its package. If your project requires a database, MySQL is essential and readily available within XAMPP.
3. Why Is XAMPP Used for MySQL?
XAMPP provides an easy-to-use, pre-configured environment that includes MySQL, Apache, and PHP, simplifying local web development and database management.