4.4 KiB
4.4 KiB
| sidebar_position | title |
|---|---|
| 4 | Database Setup |
Database Setup
Step 5 — Install Microsoft SQL Server 2012 and SSMS
5.1 — Install SQL Server 2012
- Obtain the SQL Server 2012 installer (
SQLEXPR_x64_ENU.exe) from: - Run the installer and choose New SQL Server stand-alone installation.
- On the "Database Engine Configuration" screen, under Authentication Mode, select Mixed Mode (SQL Server Authentication and Windows Authentication).
- Set the SA account password when prompted. Use the team standard password:
Root123456. - Complete the installation.
5.2 — Enable TCP/IP and Port 1433
SQL Server disables TCP/IP by default on fresh installations. The application needs it to connect.
- Open SQL Server Configuration Manager (search for it in the Start menu).
- Expand SQL Server Network Configuration → Protocols for MSSQLSERVER.
- Right-click TCP/IP → Enable.
- Double-click TCP/IP → go to the IP Addresses tab → scroll to IPAll → set TCP Port to
1433. - Click OK.
5.3 — Enable the SQL Server Browser Service
- In SQL Server Configuration Manager, go to SQL Server Services.
- Right-click SQL Server Browser → Properties → Service tab → set Start Mode to Automatic.
- Right-click SQL Server Browser → Start.
5.4 — Restart the SQL Server Service
- In SQL Server Services, right-click SQL Server (MSSQLSERVER) → Restart.
5.5 — Configure the Windows Firewall
- Open Windows Defender Firewall with Advanced Security (search in Start menu).
- Click Inbound Rules → New Rule.
- Select Port → TCP → Specific local ports:
1433. - Select Allow the connection.
- Apply to all profiles (Domain, Private, Public).
- Name the rule
SQL Server 1433and click Finish.
5.6 — Create the Application Database Login
- Install SQL Server Management Studio (SSMS). Download from Microsoft.
- Open SSMS and connect to your local instance:
- Server name:
localhost - Authentication: SQL Server Authentication
- Login:
sa - Password:
Root123456
- Server name:
📝 Note — Check your
database.propertiesbefore proceeding.Open your
database.propertiesfile and check the value ofdb.username.
- If it is
sa, skip steps 3–9 entirely. Thesaaccount already exists and was configured with the correct password (Root123456) during installation. No new login needs to be created.- If it is any other username, continue with steps 3–9 below to create that login.
- In Object Explorer, expand Security → Logins.
- Right-click Logins → New Login.
- Set the login name and password to match what is in
database.properties(provided by your team lead). - On the General page, make sure Login status at the bottom is set to Enabled (this is the default, but confirm it is not set to Disabled).
- On the Status page, under Login, confirm it is set to Enabled and under Permission to connect to database engine, confirm it is set to Grant.
- On the Server Roles page, check
dbcreatorandpublic. - Click OK.
Step 6 — Restore the Test Database
- Download the Stock project test database backup file from the Gitea release assets.
- Open SSMS and connect to your local SQL Server instance.
- In Object Explorer, right-click Databases → Restore Database…
- Select Device as the source, click … (Browse), then click Add and navigate to the downloaded
.bakfile. Click OK. - The backup details will populate in the Backup sets to restore grid. Confirm the correct entry is checked.
- Click OK to restore. A success dialog will appear when complete.
- In Object Explorer, right-click Databases → Refresh. The
TrizStockLifedatabase should now appear. - Verify the application login created in Step 5.6 has access:
- Expand TrizStockLife → Security → Users
- If your application login is not listed, right-click Users → New User, and map the login to this database with the
db_ownerrole.