How to insert a CSV file in to mysql database through mysql console

When you want to insert larger CSV file in to a mysql database using  PhpMyadmin or any other GUI tools it may take long time or even it  may be stopped. You can easily Import the CSV file in to mysql database using mysql command.  Log on to the server and  open mysql command and log on to the console and do run the following command. I guess the Db name is  testdb

use testdb;
load data local infile ‘CSVFILE.CSV’ into table TABLENAME fields terminated by ‘,’ enclosed by ‘”‘ lines terminated by ‘\n’;

XCart

XCart

You can leave a response, or trackback from your own site.

Leave a Reply

Subscribe without commenting


Fatal error: Call to undefined function wp_list_addonn() in /home/sites/customers/aneesh/systemadmin/blog/wp-content/themes/Grante/sidebar.php on line 106