I m using SQuirreL SQL and I want to import a .csv file into MySQL. Please tell how to do that.
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.
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.
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.
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.
Objects panel --> right click on the table you just created --> Import File
Then follow the wizard.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With