Am I on the right track? Is there perhaps a more direct conversion path from Excel to mysql?
There is. Just save the data as a tab separated txt file from within Excel. This is a standard save as option. Then do this in mysql client after you have created the table (which you can also do in mysql client):
mysql> LOAD DATA LOCAL INFILE '/path/to/datafile.txt' INTO TABLE table +_name;
It will load the data at a rate > 10,000 records a second so it should not take too long. The only reason to do it the slow way using DBI and DBD::mysql is if you need to do some on the fly data munging in transit.
You would create the table in the mysql client like:
mysql> CREATE TABLE jokes ( id int not null, name char(32), timestamp +date, joker char(32) );
You can use ALTER TABLE to add keys after the import or create the keys with the table. If your fields are longer than the allocated space they will be uncerimoniously truncated to fit so allocate enough room. Note char() is faster than varchar() per se but uses more space.
cheers
tachyon
In reply to Re: From excel to mysql...
by tachyon
in thread From excel to mysql...
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |