Webstorm Mysql



It can be a bit painful to get the database connection started from your PHPStorm IDE to your MySQL database. As a quick hint, this is where it went wrong with mine: MySQL wasn’t listening for incoming connections on the network (change directive bind-address to 0.0.0.0 in /etc/mysql/my.cnf and restart MySQL). MySQL Workbench enables a DBA, developer, or data architect to visually design, model, generate, and manage databases. It includes everything a data modeler needs for creating complex ER models, forward and reverse engineering, and also delivers key features for performing difficult change management and documentation tasks that normally require much time and effort. MySQL Workbench is a unified visual tool for database architects, developers, and DBAs. MySQL Workbench provides data modeling, SQL development, and comprehensive administration tools for server configuration, user administration, backup, and much more. MySQL Workbench is available on Windows, Linux and Mac OS X.

This tutorial shows how to use database browser in Intellij Community Edition.

Installing Database Navigator plugin

In this example we are using Intellij IDEA 2019.2.

Intellij community edition doesn't come with a database browser, but we can install Database Navigator plugin.

Webstorm

Open Setting dialogs and search for plugin:

Select MarketPlace tab and type database:

In the right panel (which shows Database Navigator) click on install and then click on restart IDE.

Using Database Navigator

After IDE has restarted, click on View > Tools Windows > DB Browser:

Now click on DB Browser tab on the vertical right menu.

Adding example database (MySQL)

WebstormMysql

Install MySQL server as described here. Also create an example schema (my_schema) and a table (Person) as described in the same tutorial.

In MySQL workbench check the connection properties which we will use in Intellij to connect the database.

In Intellij Click on + button and select MySQL:

Intellij Database Tool

Fill the configuration as shown:

Click on Test Connection bottom:

Click OK.

Intellij database tool

Now we can see the database details on the left panel:

Webstorm Mysql Data

Expand the Schema node, we will see my_schema and the table 'Person' which we created in MySql workbench.

Performing basic database operations

Webstorm Mysql Database

Let's insert some data in Person table.

Webstorm Php

Open database Console and execute following statement:

Webstorm Mysql Certification

Let execute select query on Person table: