0

I tried reading a very large MySQL script file with MySQL Workbench but it doesn't react. Tried with a freeware app (HeidiSQL) but it crashes.

Any idea how I can read it?

Ozkan
  • 3,880
  • 9
  • 47
  • 78
  • "Doesn't react" means what? It can take *days* to import a file like that if you're doing a straight load and your MySQL server isn't properly tuned. – tadman Jul 24 '13 at 14:28
  • @tadman: His application cant load it.. it is freezing. – Geoffrey Jul 24 '13 at 14:29
  • Do you need to import the file to a MySQL server or read it? – Vatev Jul 24 '13 at 14:30
  • Related possible? http://stackoverflow.com/questions/846475/how-to-read-large-text-file-on-windows http://stackoverflow.com/questions/159521/text-editor-to-open-big-giant-huge-large-text-files – Blaise Swanwick Jul 24 '13 at 14:30
  • @Ozkan: If you are on linux you should be able to import it by running some variation of `cat mydump.sql | mysql mydatabase`. If you need to edit something in the dump, it may be better to do it on the command line using a tool such a sed, ie: `cat mydump.sql | sed 's/find/replace/g' | mysql mydatabase` – Geoffrey Jul 24 '13 at 14:30
  • Of course it's freezing. Most MySQL importer tools are jammed while importing data. You need to check `SHOW PROCESSLIST` to see if they're doing anything useful, or if they're actually crashed. That's why using something like [innobackupex](http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/innobackupex_script.html?id=percona-xtrabackup:innobackupex:start) is really the only way to go for GB-sized databases. The SQL dump files are pretty much useless. – tadman Jul 24 '13 at 14:30
  • actually I only need to read it. I tried reading it with StreamReader (C#) but even there I get OutOfMemory exception. The purpose is to convert the table structures so it can fit in another DB – Ozkan Jul 24 '13 at 14:58
  • http://stackoverflow.com/questions/2161895/reading-large-text-files-with-streams-in-c-sharp ^ Solution for my problem – Ozkan Jul 24 '13 at 15:07

1 Answers1