I’ve tried to use the import table feature on mysql workbench to transfer csv excel files into mysql workbench but my files appear to be too large to import, it’s stuck for hours and eventually fails (see picture). I’ve even tried using xampp myphpadmin, but it times out even though I’ve amended the processing seconds to hours!
I need to be able to bring in data into sql workbench that’s more than 1,048,576 rowa which is the limit on excel. Anyone got any ideas on another way I can import data fast?
(I’ve tried the load data in file option too, but it’s not worked, not sure if I am doing this wrong, but open to suggestions)
Thanks in advance.
2
Answers
Thanks for your input, I followed your instructions and added the code to the terminal, but it comes up with the below error:
Is there any way to get around this at all?
Thanks
Regarding the large file size and also the resources that graphical user interfaces like Workbench and other applications require and the fact that maybe some machines have not it available, my suggestion is closing Workbench and all other unnecessary applications specially those with GUI and using the maximum power of your machine to import your data directly using Terminal. Open your Terminal (Command Prompt on Windows) and type:
And give it the MySQL password. Replace
[USERNAME]
with an actual MySQL username E.x.:After pressing Enter you’ll be asked for the password of that MySQL user. Typr the password and press Enter again.
Then navigate to the database that you want to insert the data into:
Change
[DATABASE]
with the actual database name.Then you can import the info using a single command:
Don’t forget to change
[PATH_TO_CSV_FILE]
and[TABLE_NAME]
with the actual strings.After the command is completed you’ll see a message like this:
After that you can see the changed on Workbench, phpMyAdmin, and by selecting from the DB.
To logout you can simply type
exit
orquit
.Meanings of the command
row of the CSV file (use 1 if you have set headers, otherwise type
0).
Note:
We have published a full course on MySQL that is available on our website and also Youtube. Also, we have a video for this specific case that you can watch right now at:
https://www.youtube.com/watch?v=phXIGogwuzY
Hope it helped.
Keep it up DataMaster!