- Laragon is installed on this computer — your teacher has set this up. It provides a local MySQL server that runs on your machine.
- DataGrip is installed — your teacher has set this up. DataGrip is the tool you will use to write and run SQL queries.
-
You have the SQL script file for your current lesson — download it from the lesson page. It will be named something like
films.sql.
Setup steps
Start Laragon and turn on MySQL
Laragon provides the MySQL server that DataGrip connects to. You must start it first, every session.
-
a
Click the Start button and search for Laragon, then click it to open. (There may also be a shortcut on the desktop.)
-
b
The Laragon control panel opens. Click Start All.
-
c
Wait a few seconds. The MySQL indicator must turn green before you continue.
Open DataGrip
DataGrip is the database tool you will use to write and run SQL queries throughout the DDD unit.
-
a
Click the Start button and search for DataGrip, then click it to open. (There may also be a desktop shortcut.)
-
b
DataGrip may take 20–30 seconds to load. The splash screen shows the JetBrains logo while it starts up.
-
c
If a welcome screen appears asking you to open or create a project, choose New Project. Name it
N5 Computing Scienceand click Create.
Activate the licence First time only
DataGrip requires a licence. The school runs its own licence server — you connect to it once and DataGrip activates automatically. You will not be asked to pay for anything.
-
a
If DataGrip asks how you want to activate, choose Licence Server.
-
b
In the server address field, enter exactly:
https://jghs.fls.jetbrains.com
-
c
Click Activate. DataGrip will connect to the school server and activate within a few seconds.
Connect DataGrip to MySQL First time only
You need to tell DataGrip where the MySQL server is. Because Laragon runs MySQL locally on this machine, the address is always localhost.
-
a
Look at the Database Explorer panel on the left side of the screen. Click the + button at the top of that panel.
-
b
From the menu that appears, choose Data Source › MySQL.
-
c
A Data Sources and Drivers dialog opens. Fill in the fields exactly as shown:
localhost
Port 3306
User root
Password (leave blank)
Database (leave blank)
-
d
If you see a yellow banner saying "Download missing driver files" — click it and wait for DataGrip to download the MySQL connector. This only happens once.
-
e
Click Test Connection. You should see a green tick and the message "Successful". If it fails, check that Laragon's MySQL is still green (Step 1) and try again.
-
f
Click OK to save the connection.
Open and run the SQL script
The SQL script creates your database and loads all the data. You run it once per database. After that, the data is saved to your H drive and you do not need to run it again.
-
a
Download the
.sqlfile from your lesson page (e.g.films.sql) — it will save to your Downloads folder. -
b
In DataGrip, go to File › Open and navigate to your Downloads folder. Select the
.sqlfile and click Open.
-
c
The SQL file opens as a tab in the editor. At the very top of that tab, look for a connection selector dropdown — it may say "No data source" or similar. Click it and choose your MySQL — localhost connection.
-
d
Press Ctrl + A to select all the text in the file, then press Ctrl + Enter to run it. Alternatively, look for the Run button (a green triangle ▶) at the top of the editor and click it.
-
e
Wait a few seconds. The output panel at the bottom should show a series of green ticks and completion messages — one for each statement in the script. No red error messages should appear.
Refresh the Database Explorer and check
After the script runs, you need to refresh DataGrip's view so it shows the new database.
-
a
In the Database Explorer panel on the left, right-click your MySQL — localhost connection and choose Refresh. (Or press Ctrl + R with the Explorer focused.)
-
b
You should now see a database named films (or handball) listed underneath the connection.
-
c
Click the arrow next to the database name to expand it, then expand tables. You should see two tables listed.
Browse the data — check the tables
Double-click a table name in the Database Explorer to open it in a data grid and see the records.
-
a
Double-click director — you should see 15 rows, one per director.
-
b
Double-click film — you should see 52 rows, one per film. Scroll right to see all 8 fields.
-
c
Some cells in the
runtime_minscolumn will show NULL — this is intentional and is something you will learn about in DDD1.
A quick look at the Query Console (you'll use this from DDD5)
The Query Console is where you type and run SQL queries. You won't need it until DDD5, but it is worth knowing where it is.
-
a
In the Database Explorer, right-click the films database (the green square icon) and choose New › Query Console.
-
b
A blank SQL editor opens. Type the following and press Ctrl + Enter:
SELECT * FROM director;
-
c
The results appear in the panel below the editor — you should see all 15 directors. This is how all SQL queries work in this unit.
Troubleshooting
localhost and Port is 3306.DROP TABLE IF EXISTS lines at the top will safely clear any partial data before re-creating everything.