I m using SQuirreL SQL and I want to import a .csv file into MySQL. Please tell how to do that.
2 Answers
According importing-data-from-a-file-like-csv you should right-click on the table, where you want to import into, and in the context menu you should see a menu-item called "Import file", where you choose your csv-file.
With F1 -> Help -> Data Import Plugin you should get some help about that.

- 6,412
- 1
- 14
- 29
-
1There is no Import file option when right click on table. What precisely is a context menu? Also do i need to import some seperate jar file?? – kratika gupta Oct 07 '14 at 11:01
-
1maybe you need to install some plugins http://squirrel-sql.sourceforge.net/index.php?page=plugins. Context menu is the menu, that opens, when you right click on an element. – sqlab Oct 07 '14 at 11:59
-
I got that import file option. Now the problem is that the file I want to import has 200+ columns. Do I need to first create 200+ columns and then import or is there any other method to import the whole file directly? – kratika gupta Oct 08 '14 at 04:40
-
1Probably you have to create the columns by yourself. Be aware, that all rows already filled before the import, are wiped after the import. – sqlab Oct 08 '14 at 05:36
-
Execute the install jar and install to the existing location. When faced with the options, add the Data Import Plugin, and uncheck the "Standard" option to keep your existing install. – Ryan D Aug 31 '17 at 18:52
If you need to create the table from .CSV
My case differs a bit in that I have the table exported to a .CSV and I need to create and import the table from that file.
1. Get the column definitions
a. You have access to the original source
If you exported the CSV yourself from another database, you might as well go back to that database and get the "create table script" from there (objects panel --> right click on the table in question --> Scripts --> Create Table Script).
Same case if you can reach out to the originator of the .CSV: you may ask for the Create table script.
b. You just have the .CSV
Connect to the .CSV as a database from within SQuirreL (you may use hxtt, csvjdbc or cdata) and you can get the Create table script.
But this way (well, I tried csvjdbc), you just get all columns as varchar(max)
and you will have to edit them to your liking. For 200+ columns, this might be a little bit of a pain. On the other hand, you get the data inside a DB and then you might exercise your SQL wizardry and convert data into another table, with proper column definitions.
2. Create the table in your destination schema
That is just connecting to the DB and Schema where you miss the table and running the Create table script there. You will get the empty table.
3. Import the data
Objects panel --> right click on the table you just created --> Import File
Then follow the wizard.

- 1,696
- 1
- 22
- 32