I’ve wasted abit of time doing this today…
1. Create your database
>mysqladmin create dbname
2. Create your table with the right fields. (I usually use an Admin tool like phpmyadmin to do this).
3. You need to login to your mysql console
>mysql -u root
>use dbname;
>LOAD DATA LOCAL INFILE 'path_to_my_file.csv' INTO TABLE tablename
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\\r\\n'
OPTIONALLY ENCLOSED BY """" (field1,field2,field3);
4. Play around with the TERMINATED BY setting and OPTIONAL setting for your own need.
Latest Entries
Archives
- November 2008
- September 2008
- August 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- November 2007
- July 2007
- June 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- February 2006
- January 2006
- December 2005
Categories
- ankoder (1)
- australia (2)
- business (13)
- china (4)
- conference (1)
- environment (2)
- facebook (1)
- firefox (1)
- git (2)
- github (2)
- hong kong (1)
- interface (1)
- internet (1)
- javascript (1)
- jobboard (1)
- olympics (1)
- osx (1)
- personal (14)
- politics (5)
- railscamp (1)
- rorcraft (4)
- ruby on rails (4)
- scriptaculous (1)
- startup (2)
- sydney (1)
- taiwan (1)
- travel (3)
- trend (1)
- trends (1)
- twitter (1)
- Uncategorized (9)
- unfuddle (1)
- usability (1)
Twitter Updates
I am the founder of RoRCraft Ltd., a web consultancy firm that develops usable and speedy web applications for our clients.
Based in Sydney, I travel to Hong Kong and HangZhou China to meet with my team regularly. I love exploring new technologies and business ideas that helps making our world a better place.

An online video conversion tool. It allows everyone to freely convert their videos for ipods, mobiles and flash.
Rails Job
Job board for Ruby and Rails developers.

Jul 18th, 2007 at 8:15 pm
Thanks for Sharing..