Creating a New Database on XAMPP

Jul 16, 2024

Creating a New Database on XAMPP

Introduction

  • Video: Creating a new database on XAMPP
  • Tool: XAMPP Control Panel
  • Tasks:
    1. Starting MySQL server
    2. Creating a new database
    3. Adding a table with columns
    4. Exporting and importing databases

Steps

Starting MySQL Server

  • Open XAMPP Control Panel
  • Start MySQL by clicking 'Start'
  • To access XAMPP Control Panel:
    • Go to Start Menu
    • Type 'XAMPP Control Panel'
    • Click 'Open'

Accessing phpMyAdmin

  • Open browser
  • Type localhost
  • Press Enter
  • Click on phpMyAdmin
  • Default databases will be visible

Creating a New Database

  • Click on 'New' in phpMyAdmin
  • Enter Database name (e.g., amit_db)
  • Click 'Create'
  • New database amit_db will be visible
  • Empty database initially (no tables or columns)

Creating a New Table

  • Click on the database (e.g., amit_db)
  • Click on 'New' to create a table
  • Enter table name (e.g., employee)
  • Enter number of columns (e.g., 3)
  • Click 'Go'
  • Define columns:
    • emp_id (Type: INT, Primary Key)
    • emp_name (Type: TEXT)
    • emp_age (Type: INT)
  • Click 'Save'
  • Table employee with columns emp_id, emp_name, emp_age created

Editing and Dropping Tables

  • Table operations available:
    • Edit table
    • Drop (delete) table

Exporting a Database

  • Click on 'Export'
  • Select format (e.g., SQL)
  • Click 'Go'
  • Downloads file (e.g., amit_db.sql)

Importing a Database

  • Click on 'Import'
  • Choose file (should be in SQL and compressed)
  • Click on 'Go'

Conclusion

  • Successfully created and managed database using XAMPP
  • Reminder to subscribe to the channel for more tutorials