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.

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 are the easy steps to get started with MySQL XAMPP:

Simplify ETL with Hevo’s no-code Data Pipeline

Hevo Data with its strong integration with 150+ Data Sources & BI tools such as MySQL, PostgreSQL, MS SQL Server, etc., allows you to not only export data from sources & load data in the destinations, but also transform & enrich your data, & make it analysis-ready so that you can focus only on your key business needs and perform insightful analysis using BI tools.

Start for free now!

Get Started with Hevo for Free

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
Image Source

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
Image Source

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
Image Source

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
Image Source

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
Image Source

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
Image Source

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
Image Source

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
Image Source

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
Image Source
  • 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
Image Source

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.

visit our website to explore hevo

Give Hevo Data a try and sign up for a 14-day free trial today. Hevo offers plans & pricing for different use cases and business needs, check them out!

FAQ on XAMPP MySQL Database

How to connect to MySQL in XAMPP?

To connect to MySQL in XAMPP:
Open phpMyAdmin
Use ‘root’ as the username and leave the password field blank (default configuration).

Is XAMPP different from MySQL?

Yes, XAMPP is different from MySQL. XAMPP is a software package that includes MySQL (or MariaDB), Apache HTTP Server, PHP, and Perl, designed to create a local web server environment for development and testing purposes.

Is XAMPP good for beginners?

Yes, XAMPP is often recommended for beginners because it provides an easy-to-install and configure environment for running a local web server on Windows, macOS, or Linux.

Share your experience of how to use XAMPP MySQL Database in the comments section below!

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.

No-code Data Pipeline for MySQL