Inserting data to MySQL from file (csv, sql) in PhpStorm

searching a solution for a similar issue I found a way to import data to mysql phpstorm data resource from the sql console typing this:

LOAD DATA LOCAL INFILE 'C:/your_csv_file.csv' 
INTO TABLE your_table 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '' 
LINES TERMINATED BY '\n' 
(column1, column2, column3, ...);

Maybe could be useful for you.


Add the sql file to your project files, right-click this file in the Project view and select "Run {filename}" You will then be asked to select the right database, on which the sql will execute.


Step by step guide to execute Mysql Script from PhpStrom or any Jet Brain's intelligence IDE

1.Put your MySQL script file in current project directory.

2.Right click and select option Run_{fileName.sql} from Context menu (Tip: you can also select multiple files if you want.)

enter image description here

3.Select appropriate Schema/database name in Target data source/Schema

enter image description here

4.click on Run button. After that execution of operations will going to start.