Forum Moderators: coopster
I have a huge text file that i don't have a way to upload directly into a MySQL database because my webhost isn't allowing it for some reason.
mysql -p database < textfile.txt
mysql> USE database;
mysql> LOAD DATA LOCAL INFILE "textfile.txt" INTO TABLE table;
If you have a test server, you can put the data into it, get it the way you want, then use mysql dump to get it out. Then upload the dump file.
As I write that, though, it starts to sound like more trouble than writing a script to import directly, depending on your situation.
Tom
What I ended up doing was uploading via ftp the dumpfile.sql and then logging into the shell and doing this
mysql -u username -p < /path/to/dumpfile.sql
and that worked flawlessly. The only other option I had would be to chop it up into manageable pieces and I didn't feel like cutting up 2,000,000 rows manually.