Learn Databases MYSQL

HermantoXYZ
2 min readJun 15, 2024

--

Sure! Here’s a guide on how to learn and use databases with XAMPP using the command prompt. This guide assumes you have XAMPP installed on your system.

Step 1: Install XAMPP

  1. Download XAMPP: You can download XAMPP from the official website.
  2. Install XAMPP: Follow the installation instructions. Choose the components you need, typically you will need Apache and MySQL.

Step 2: Start Apache and MySQL

  1. Open XAMPP Control Panel: Start the XAMPP Control Panel from your Start Menu or Desktop shortcut.
  2. Start Apache and MySQL: Click the “Start” button next to Apache and MySQL modules. Ensure both are running (indicated by green highlighting).

Step 3: Open Command Prompt

  1. Open Command Prompt: You can open the command prompt by pressing Win + R, typing cmd, and pressing Enter.

Step 4: Log in to MySQL

Open terminal Command Prompt
If you haven’t set a password for the MySQL root user, just press Enter when prompted for a password.

Step 5: Basic MySQL Commands

Here are some basic commands to get you started:

  1. Show databases:
SHOW DATABASES;

2. Create a database:

CREATE DATABASE mydatabase;

3. Select a database:

USE mydatabase;

4. Export Databases MySQL

C:\Users\LEGION>
mysqldump -u [username] -p [database_name] > [output_file].sql

4. Exit:

EXIT;

By following these steps, you should be able to set up and use a MySQL database using XAMPP and the command prompt. Happy learning! HermantoXYZ (Andi Hermanto)

--

--

No responses yet