The XAMPP Stack of Software is an Open-source Localhost-based server encompassing software packages that offer several functionalities. You can use the XAMPP Control Panel to start or deactivate all Software that comes with it.

With XAMPP, you can test projects/modifications before releasing them online. The MySQL Database forms a vital component of the XAMPP Stack, being one of the most significant features offered by it. With XAMPP, you can use phpMyAdmin to create & use your XAMPP MySQL Database in minutes. 

This article will provide a full explanation of what XAMPP is and how to use it to build a XAMPP MySQL Database.

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 create a local web server for testing purposes on your own computer, enabling web developers to easily test their applications during development.

XAMPP can be downloaded from here.

Skip Manual Coding and Replicate MySQL Data Automatically

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 Free

What is MySQL?

MySQL is an open-source relational database management system based on SQL, that 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, reliable storage and retrieval of website and app data like 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

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.

XAMPP MySQL 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:

XAMPP MySQL - XAMPP Control panel

XAMPP MySQL 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

XAMPP MySQL Step 4: Creating a Database

Next, we will learn how to create 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.

XAMPP MySQL - Creating Database

XAMPP MySQL 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, give a table name and the number of columns.
  • Click the Go button. This prompts you to input the column information.
XAMPP MySQL

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));
XAMPP MySQL

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.

  • Mac users may hit Control+Enter to run.
  • For Windows users, press Control+Enter to run.

XAMPP MySQL 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.
XAMPP MySQL

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!");
XAMPP MySQL

To run the command, simply click the Go button.

  • Mac users may hit Control+Enter to run.
  • For Windows users, press Control+Enter to run.

Understand how Data Loading takes place in MySQL with our comprehensive guide. 

XAMPP MySQL Step 7: Retrieve Data

There are various ways for retrieving data from a table.

You may utilize the Browse option.

  • On the phpMyAdmin screen, pick the guestbook database and then the entries table.
  • Select the Browse tab. This will display all existing records in the table.
XAMPP MySQL

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.

  • Mac users may hit Control+Enter to run.
  • For Windows users, press Control+Enter to run.

XAMPP MySQL 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
XAMPP MySQL

To run the command, simply click the Go button.

  • Mac users may hit Control+Enter to run.
  • For Windows users, press Control+Enter to run.

Check out our guide to import data from CSV into MySQL.

XAMPP MySQL Step 9: Export SQL File

XAMPP MySQL
  • 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.
  • Mac users may hit Control+Enter to run.
  • For Windows users, press Control+Enter to run.

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 - Saving the Database
Replicate Data from MySQL to MS SQL Server
Replicate Data from MySQL to Snowflake
Replicate Data from PostgreSQL to MySQL

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: E-commerce applications typically use 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

So you can see how crucial MySQL is in the world of Web Development. In layman’s terms, XAMPP MySQL can be compared to the backbone of a project. I’ll explain why!! To be successful, a project must be carefully tested. As a result, you’ll need a safe and well-equipped platform for this. XAMPP provides the necessary platform, complete with all of the necessary components.

Managing rising databases and the number of linked procedures such as Business Analytics, on the other hand, is not an easy task. Migrating large volumes of data from MySQL to a Cloud-based Data Warehouse is a time-consuming and inefficient operation, but with a Data Integration tool like Hevo Data, you can do it in no time and with no effort.

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.

Davor DSouza
Research Analyst, Hevo Data

Davor DSouza is a data analyst with a passion for using data to solve real-world problems. His experience with data integration and infrastructure, combined with his Master's in Machine Learning, equips him to bridge the gap between theory and practical application. He enjoys diving deep into data and emerging with clear and actionable insights.