Skip to content
Logo Theodo

How to Manipulate the MySQL Database of your Vagrant from PhpStorm

Quentin Febvre2 min read

Untitled drawing

Why should I care?

How many hours have you spent logged on your Vagrant trying to type your query, copying in a text editor, pasting, then raging because the console goes crazy and you have to start all over again?
Well, spend five minutes to follow the next steps and see the pain of manipulating your data disappear!

Step 1:

Open your project in PhpStorm and open the DataSource window:

Step 2: configure the ssh tunnel

config_ssh_vagrant

Click on the apply and then click on Test Connection, you should see an error message saying you’ve got the wrong user/password combination

Step 3: Set up the database configuration

Case 1 -> It works! congratulations you can now manipulate your DB from within your IDE

Case 2 -> You get a wrong user/password combination error. Don’t panic! just do the following:

A few use examples:

  1. Explore the schema of your tables on the sidebar
  2. Open the console file and enjoy:
    • the autocomplete
    • the syntactic correction and coloration
    • write multiple queries and execute the one you want (Ctrl + Enter)
    • paginated scrollable results
    • execute multiple queries at the same time,
  3. Update or add data to your database from the graphical interface.

Liked this article?