Installing MySQL Server
Installing MySQL Server
On Windows use MySQL Installer; on Linux the mysql-server package or Docker mysql:8 image. For this course a local server with one test database is enough.
Record the root password during setup. Immediately create an application user with minimal hotel_db rights — never share root with PHP. In hotel_db reception, finance, and housekeeping share gosti, sobe, rezervacije, placanja, and zaposleni — every change must stay consistent for all app modules.
In depth
Verify the service on Windows Services or systemctl on Linux. Set utf8mb4 default charset so Cyrillic and emoji in guest names work. In Workbench run the sample SQL on test data before production, check EXPLAIN as tables grow, and document expected results for teammates.
Key points
- Installer or Docker for local dev. — hotel_db example.
- Save root password securely. — hotel_db example.
- Dedicated app user. — hotel_db example.
- Confirm service running. — hotel_db example.
- utf8mb4 for international text. — hotel_db example.
Practical example
Creating app user.
CREATE USER 'hotel_app'@'localhost' IDENTIFIED BY 'jaka_lozinka';
GRANT SELECT, INSERT, UPDATE, DELETE ON hotel_db.* TO 'hotel_app'@'localhost';Common mistake
Leaving empty root password locally because it is convenient. Typical fallout: mismatched reception vs finance data, lost reservations, or blocked check-ins at peak season — always backup before production DDL/DML.
Summary
Proper install and users come before building hotel_db. Practice again on hotel_db until you can explain every result row and tie it to hotel workflows (check-in, billing, reporting).
Note: Tip: keep versioned .sql scripts (hotel_schema.sql, seed.sql) in Git — reproducibility matters when several people work on the same hotel_db model.
