How does PHPStorm manage SQL database?

Tram Ho


A: If you are tired of installing IDEs for your coding, come to PhpStorm!

B: Yes, if I can code using PhpStorm, can I manage the database using PhpStorm? 🙃

A: Yes. PhpStorm is also a great database tools .

B: So what do I have to do to get that great?

A: Configuration, simple as knitting 😹

B: But I don’t know how to knit !! 😿

A: Yes, so you can refer to the simple way below to figure out how to knit.

Database tools and SQL


PhpStorm can become a database tools with the Enable plug-in Database tools and SQL . Select File -> Setting -> Plugin then search for SQL select Database tools and SQL select Enable .

Then we start to use it. At the tool bar on the right of the screen we can see the Option Database has appeared, click on it to begin. Or if you do not see, you can choose View -> Tool Windows -> Database .

Create connection: Database connection

With Database tools and SQL , you can query, create and manage databases. Databases can work locally, on the server or on the Cloud. The plugin supports MySQL, PostgreSQL, Microsoft SQL Server, SQLite, MariaDB, Oracle, Apache Cassandra and other tools. See the full list of supported providers in Connect to Database.

Configuration according to needs, here I configure local machine, username root, database laravel. Click Test Conneciton to check whether the database is connected or not.

Once we have created the connection to the local server, we can create a new database by right-clicking the schemas selecting New -> schema … Here we can continue the New table or import database by Right-click a schema or table and select Import Data from File . (Usually, Export will go to / home / {username} / dumps directory so you can choose to import the file included in this)

On the other hand, if your database already has a database, you can show it by right-clicking and selecting Database tools -> Manage Shown Schemas and selecting ALL or each database you want to display.

Now we have finished connecting! Start creating database for the table

Add data to the table via Add New Row or Alt + Insert then Ctr + Enter to add

We can also edit the table, adjust the primary key … by clicking directly on the table name.

To create a query in the table, click the QL icon on the toolbar of Database tool and SQL , and start typing (PhpStorm already supports most query keywords in SQL). When running these queries, the console screen will be displayed informing the commands that are run, runtime and results.

See diagram

Another great feature of Database tool and SQL is being able to show users the diagram of csdl or add tables

You can room the diagram by holding ALT + left mouse button

Export database

Select the table you want to export -> right click -> Dump Data to File -> select the file type to export


Database tool and SQL:

  • Search and edit data directly on the graphical interface
  • Complete the query yourself
  • Fast analysis and correction
  • Import / export file
  • Support birth chart

Using PhpStrorm to manage database is also full of features of specialized IDEs so do not hesitate to use 😇

You can read more on the homepage of jetbrains to learn more about this great feature. Thank you for reading 🍁🍁🍁

Share the news now

Source : Viblo