To create a MySQL database with XAMPP, you can follow these steps:
1. Navigate to XAMPP in your system or simply launch it by clicking the XAMPP icon.
- The Control Panel is now visible and can be used to initiate or halt the working of any module.
2. Click on the “Start” button corresponding to Apache and MySQL modules.
- Once it starts working, the user can see the following screen:
3. Now click on the “Admin” button corresponding to the MySQL module.
- This automatically redirects the user to a web browser to the following address – http://localhost/phpmyadmin
4. One can see a number of tabs such as Database, SQL, User Accounts, Export, Import, Settings, etc. Click on the “Database” tab.
- Here you can see the Create option. Choose an appropriate name for the input field titled Database name. Things to keep in mind while selecting the name for the database are;
- The number of characters used should be equal to or less than 64.
- The name should comprise letters, numbers, and an underscore.
- The DB name should not start with a number.
- It should be relevant to the topic for which it is being created.
Take note: Make sure the database is successfully created.
5. It is very important to create tables in order to store the information in a systematic manner.
- In this step, we will build tables for the created database. In the created Database (Login page in this case), click on the ‘Structure’ tab. Towards the end of the tables list, the user will see a ‘Create Table’ option. Fill the input fields titled “Name” and “Number of Columns” and hit the ‘Go’ button.
6. Now, we have to initialize our columns based on their type.
Enter the names for each of your columns, select the type, and set the maximum length allowed for the input field. Click on “Save” in the bottom right corner. The table with the initialized columns has been created. You can create any number of tables for your database.
That’s it! You have now created a new MySQL database using XAMPP to store data for your web applications. You can also create tables and define their structure using the phpMyAdmin interface.