bubble_chart StackLab

Database Migration

19 steps · pending Not started · person_outline Guest
arrow_back Back

Run the migration

There are several ways to run the migration.

Option A: MySQL command line

Open a terminal and connect to MySQL:
code bash
mysql -u root -p
Enter your password when prompted. Then select the database:
code sql
USE library_db;
You can also create the database from the command line if you haven't already:
code sql
CREATE DATABASE library_db
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;

USE library_db;
Exit the MySQL prompt if needed, then run the migration file:
code bash
mysql -u root -p library_db < database/migrations/001_initial_library.sql
On Windows, you can use the full path:
code bash
mysql -u root -p library_db < "C:\path\to\your-project\database\migrations\001_initial_library.sql"

Option B: phpMyAdmin

If you're using phpMyAdmin:
  1. Open phpMyAdmin.
  2. Select library_db.
  3. Open the Import tab.
  4. Select 001_initial_library.sql.
  5. Start the import.
  6. Check the database after the import finishes.

login Sign in to save your progress permanently. info Progress is saved in your browser session
format_list_numbered Step 12 of 19