N3/N4  ·  ISDD  ·  Before you start

Setting up Laragon, MySQL and DataGrip

National 3 & National 4 Computing Science Laragon · MySQL · DataGrip Do this once before ISDD1 Approx 10 min
Before you start — check both
  • Laragon and DataGrip are installed on this computer — your teacher has set this up, along with a database connection already pointing at your class database. You don't create a new connection yourself.
  • You have your H drive (network storage) available — DataGrip stores its connection settings there, which is why your databases are still there when you log back in next lesson.

Setup steps

1

Start Laragon

Laragon runs the MySQL database server in the background. It must be running before DataGrip can connect to anything — this is the single most common thing pupils forget at the start of a session.

  • a

    Open Laragon from the Start menu or desktop shortcut.

  • b

    Click the Start All button in the Laragon window.

  • c

    Wait for the MySQL indicator to turn green before moving on.

Laragon
MySQL   Apache
Green means go. If the MySQL indicator is still red or amber, DataGrip will not be able to connect in Step 4 — give it a few seconds after clicking Start All.
2

Open DataGrip

DataGrip is the program you'll use to view and query your databases throughout the ISDD strand.

  • a

    Open DataGrip from the Start menu.

  • b

    If a licence prompt appears, it should connect automatically to the school's licence server. Let your teacher know if it doesn't.

Don't create a new database connection. Your class database connection is already configured — you only need to find it in the Database Explorer (Step 3).
3

Find your database in the Database Explorer

The Database Explorer is the panel on the left of the DataGrip window. Because DataGrip stores its settings on your H drive, the same connection and any databases you've already built will still be there when you log in again next lesson.

  • a

    Look at the panel on the left — this is the Database Explorer.

  • b

    Your connection should already be listed. Click the small arrow beside it to expand it.

▶ localhost (MySQL)
▼ bike_scotland
tables
Nothing under your connection yet? That's expected before ISDD2 — you haven't created a database yet. The connection itself should still be visible even with nothing inside it.
4

Open a New Query Console

SQL commands are written and run inside a Query Console, not typed directly into the Database Explorer.

  • a

    Right-click your database connection (or the specific database, once you have one) in the Database Explorer.

  • b

    Choose New, then Query Console.

Right-click database New Query Console
Query Console — [localhost]
-- Write your SQL here, then run it
One console is enough. You can reuse the same Query Console for a whole lesson — you don't need to open a new one for every command.
5

Test the connection

Before starting a lesson, run one harmless command to confirm everything is connected properly.

  • a

    In the Query Console, type exactly:

SHOW DATABASES;
  • b

    Run it by clicking the ▶ (Execute) button, or pressing Ctrl + Enter.

  • c

    A results table should appear underneath, listing the databases MySQL currently knows about.

Query result
Database
information_schema
mysql
connection working
You're all set! If a results table appeared with no red error message, your setup works and you're ready to start ISDD1.

Troubleshooting

✗  DataGrip says "Could not connect" or shows a red error
This almost always means Laragon's MySQL hasn't started yet. Go back to Step 1, check the MySQL indicator is green in Laragon, then try running your query again.
✗  The MySQL indicator in Laragon stays red or amber
Wait a few extra seconds and check again — MySQL can take a moment to start. If it's still not green after a minute, close Laragon fully and reopen it, then click Start All again. If it still won't turn green, ask your teacher.
✗  I can't see any database connection in the Database Explorer
Check you're logged in with the same account as last time, since DataGrip's settings are stored on your H drive. If the panel is genuinely empty, ask your teacher rather than creating a new connection yourself.
✗  DataGrip shows a licence error
DataGrip should collect its licence automatically from the school's licence server. If you see a licence error dialog, let your teacher know rather than entering any details yourself.
✗  I ran SHOW DATABASES; but got a red error instead of a results table
Check you typed the command exactly, including the semicolon at the end. If the spelling is correct and it still fails, re-check Steps 1–2 — this is usually a sign MySQL isn't actually running yet.