mattastic — 2012-10-04T10:26:48-04:00 — #1
I'm trying to import a large .sql file (270Mb) using SQL Workbench.
I'm exporting from phpmyadmin v220.127.116.11: structure and data, all statements, with syntax INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)
Does anyone know how I can import it without getting the error?
Its for a wordpress install.
Thanks in advance.
cpradio — 2012-10-04T11:15:04-04:00 — #2
Can you split the file into smaller chunks? Then do each small file one at a time?
rcashell — 2012-10-04T12:25:43-04:00 — #3
I found this: http://bugs.mysql.com/bug.php?id=55312
"The MySQL Workbench SQL Editor is by design not able to load such big scripts. The upper limit is around 100MB, depending on available RAM. A new tool will soon be available to allow executing large scripts (without source
code support, like syntax highlighting, or edit abilities)."
So it looks like you will have to manually go in and break this into several files each less than 100Mb.
mattastic — 2012-10-04T13:26:55-04:00 — #4
Thanks for the replies folks.
How is it best to split up the file and sql syntax?
Would anywhere after a ';' be ok to split?
r937 — 2012-10-04T13:35:11-04:00 — #5
not sure if notepad can load such a big file
ultraedit (my text editor) can, and there's a 30-day free trial
yes, anywhere after a semi-colon is safe to split the file
spacephoenix — 2012-10-04T14:22:32-04:00 — #6
What language is being used server-side at the destination? One option provided you're carefully would be to have the server-side language, work its way through the file and insert the rows in say batches of 50.
kylewolfe — 2012-10-04T14:32:40-04:00 — #7
The workbench is not capable, but what about the command line tool? I feel like I have imported csv's well over several hundred MB last year.
rcashell — 2012-10-04T14:45:39-04:00 — #8
You can try the command line utility to see if that works. According to the bug report this seems to be isolated to only MySQL Workbench. It is always worth a try - you never know it might work!!
kylewolfe — 2012-10-04T15:03:14-04:00 — #9
I've confirmed that my csv's from my last years project were >=140mb. I ran a bash script daily to first run a sqlplus dump from oracle into a csv then then into my local mysql db, never saw an issue other than some isolated data type problems.
mattastic — 2012-10-04T15:52:36-04:00 — #10
Thanks for all the replies folks
Great stuff, just installed it, but how do you select an area of code? The page scrolls for miles x and y
r937 — 2012-10-04T17:04:53-04:00 — #11
highlight by click and drag with the mouse, or shift plus arrow keys
mattastic — 2012-10-05T06:16:38-04:00 — #12
Still having trouble with this file.
I can't highlight and scroll through code to copy it, the files just too big and unmanagable.
Using phpmyadmin, can I export one table at a time or split it up somehow that way?
rcashell — 2012-10-05T06:29:35-04:00 — #13
If you can connect to the MySQL with the command utility you should really look at using that. I think you will save more time using the command line utility than attempting to split the file up.
mattastic — 2012-10-05T07:09:47-04:00 — #14
Thanks very much for the reply.
I can login to the server and see mysql installed under programs.
How do I access in via the command prompt, and is it simple to do?
mattastic — 2012-10-05T08:08:29-04:00 — #15
I've managed to create the db, and use the following prompt to import the database:
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u xxx -p xxx benpct
All That happens if I get a load of myql information and version information, it doesn't say its imported successfully.
Can anyone please help?