-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_database.bat
More file actions
60 lines (54 loc) · 1.63 KB
/
Copy pathsetup_database.bat
File metadata and controls
60 lines (54 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@echo off
echo ============================================
echo Textbook Selling System - Database Setup
echo ============================================
echo.
echo This script will help you set up the MySQL database.
echo.
echo Prerequisites:
echo - MySQL Server must be installed and running
echo - You need to know your MySQL root password
echo.
pause
echo.
echo Setting up the database...
echo.
REM Get the current directory
set SCRIPT_DIR=%~dp0
REM Run MySQL command to create database and import schema
echo Please enter your MySQL root password when prompted.
echo.
mysql -u root -p < "%SCRIPT_DIR%database_setup.sql"
if %ERRORLEVEL% EQU 0 (
echo.
echo ============================================
echo Database setup completed successfully!
echo ============================================
echo.
echo Database Name: book_selling_system
echo.
echo Default Admin Credentials:
echo Username: Soumya
echo Password: 1234
echo.
echo Sample User Accounts:
echo 1. Username: johndoe, Password: password123
echo 2. Username: janesmith, Password: password456
echo.
echo You can now run the application!
echo.
) else (
echo.
echo ============================================
echo Error: Database setup failed!
echo ============================================
echo.
echo Please check:
echo 1. MySQL Server is running
echo 2. You entered the correct password
echo 3. You have permission to create databases
echo.
echo For manual setup, see DATABASE_SETUP_README.md
echo.
)
pause