Set up and work with MySQL on Windows with XAMPP
I. What is XAMPP?
XAMPP is an open-source server setup for testing projects on a local machine before making them available to everyone over the web. This web app development server comes pre-installed with an Apache web server, MySQL database, PHP, and Perl, which help you build an offline application with the desired features and functions.
XAMPP is a lightweight solution that works perfectly on multiple platforms like Linux, Windows, and Mac OS.
II. What is MYSQL?
MySQL is an open-source relational database management system (RDBMS) that relies on SQL (structured query language). Most web-based applications use RDBMS for development. Basically, MySQL helps you structure your data, present the information in an organized manner, and edit, delete, update, or retrieve data whenever required.
III. How to Install XAMPP on Windows 10
Let’s get started with the step-by-step guide on how to install XAMPP on Windows 10.
Step 1: Download and Install XAMPP
To download and install XAMPP, go to apachefriends downloads page.
You will see XAMPP ready to download for cross-platform platforms like Windows, Linux, and Mac OS X. Since we are discussing how to install XAMPP on Windows 10, we will choose the Windows option, as shown below.
Step 2: Run the Installer to Install XAMPP
1. XAMPP Setup Wizard
During the installation process, you may come across warning pop-ups. But you would probably click ‘Yes’ to start the installation process. Soon after you click on the downloaded file, the XAMPP setup wizard will open. Now click on the ‘Next’ Button to proceed.
2. Select Components
Next, you need to check the components you want to install and can uncheck or leave them as they are if you don’t want to install them. You can see there are a few options that are light grey in color. These are the options necessary to run the software and will automatically be installed. Now click on the ‘Next’ button to continue.
3. Select Installation Folder
Now, you need to choose the folder where you want to install XAMPP. You can choose the default location or any location of your choice, and then click the ‘Next’ button to proceed.
4. Select language
Now, you will see a window showing you information about the language. You can choose which language you want to work with. Then, click on the ‘Next’ button to continue.
5. Bitnami for XAMPP
Now, you will see a window showing you information about Bitnami. Simply click on the ‘Next’ button to move further. However, to learn more about Bitnami, you may check the box saying ‘Learn more about Bitnami for XAMPP.’
Bitnami is for installing open source applications i.e. WordPress, Joomla etc on your newly installed XAMPP.
6. Ready to Install XAMPP
Now, you’ll see another window with the message “Setup is now ready to begin installing XAMPP on your computer,” as shown below. You just have to hit the ‘Next’ button to proceed.
7. Waiting for installing process
8. XAMPP Installation Complete
Once the installation is completed, you will be asked whether you would like to start the control panel now. The message “Do you want to start the control panel now?” will appear. Check the box, click on the ‘Finish’ button, and see if XAMPP is working fine.
Step 4: XAMPP is now installed on Windows, run it
If the entire XAMPP installation process went correctly, the control panel would open smoothly. Now, click on the ‘Start’ button for Apache and MySQL.
IV. Create a simple MYSQL Database on XAMPP with phpMyAdmin
To work with MYSQL, we need a web interface, phpMyAdmin, which makes working with the database easy and simple. Click 'Admin' on the Xampp Control Panel or enter the link http://localhost/phpmyadmin/ to access it.
1. Create your first Database
You can create your Database by clicking 'New.' Then, you will see the form that you need to complete to create your own. Enter the name of the Database and the charset, then click 'Create' to start creating.
2. Create a Table on your Database
After successfully creating a Database, you can see it in the list on the left side. On the right side, you can create a table by entering the name and number of columns, then clicking 'Go' to proceed.
You can set the field name, type, length, etc., in your table and then click 'Save' to complete creating It.
Done. You can see all the tables in the left-side list, and to update them, simply create more tables.
3. Set the Password for phpMyAdmin on XAMPP
Step 1: On the phpMyAdmin page, click on the ‘User accounts’ option at the top.
Step 2: Now, press the ‘Edit Privileges’ under ‘Actions’ option for the Username ‘root’ and Hostname ‘localhost.’
Step 3: Now choose the third tab, ‘Change password,’ and type your password in the provided field. Retype the password to confirm it, and then finally click on the ‘Go’ key to conclude the process.
4. Import Database on XAMPP phpMyAdmin
To import a MySQL database via phpMyAdmin XAMPP, follow the steps below.
- Open the Database in phpMyAdmin.
- Click on the Databases from the top menu.
- Select the database name from the drop-down menu you want to import.
- Click on the Import tab.
- Browse your .sql file by clicking on the ‘Choose File’ option you wish to import. And then click on the ‘Go’ button at the bottom.
- You’re done!!
5. Export Database on XAMPP phpMyAdmin
In order to export a MySQL database via phpMyAdmin XAMPP, follow the following steps.
- Log in to the cPanel and open the phpMyAdmin interface to begin the export process.
- In the left pane of phpMyAdmin, select the database you want to export.
- Select the ‘Export’ tab at the top.
- Now, you shall see two options: Quick and Custom. You can select Quick if you want to use the default option or select Custom if you want to select particular tables and compression types for the exported file, in addition to many other options.
Note: The older version of phpMyAdmin does not support Quick. So you’ll have to follow another method for that.
- Now, select the format you wish to export your database in. Click on the drop-down menu and select one from the list.
- Confirm your choice by clicking on the ‘Go’ button.
- Now, you will be asked to open or save the chosen file. You may select "save file" and save it to your desired location.
Congratulations!! You have successfully exported the file.
V. Conclusion
As you can see, all the features in phpMyAdmin XAMPP are greatly powerful, giving you the freedom to manage the database efficiently.
Now, you can easily install your own Machine to work with MYSQL on XAMPP. Certainly, the biggest advantage of installing XAMPP is that you don’t have to worry about the number of attempts you make or the kind of experiments you perform on your site. You can freely try anything you want without any tension of losing your users.