Export Data XLS ke MySQL

Buka file XLS dengan word/openoffice lalu save as dengan format csv,
Setelah itu buka console mysql atau bisa juga menggunakan phpmyadmin
ketikkan baris berikut ini di SQL (phpmysql) atau di console:

LOAD DATA INFILE ‘/home/user/public_html/data/file.csv’
INTO TABLE jos_enindo_dir_company
FIELDS TERMINATED BY ‘,’ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘\n’
(field1,field2,field3,field4);

yang perlu diperhatikan adalah baris pertama ketika load data pastikan path file *.csv benar contoh diatas menggunakan sistem operasi linux, kalau menggunakan windows gunakan :

LOAD DATA INFILE ‘C:/wamp/www/data/file.csv’

kemudian baris (field1,field2,field3,field4); adalah field dari table yang akan kita isi dengan data di csv, pastikan jumlah field nya sama antara yang di csv dan database.

<ul><li>xls to mysql (147)</li><li>export xls to mysql (26)</li><li>convert xls to mysql (23)</li><li>mysql to XLS (7)</li><li>how to export mysql to xls (6)</li></ul>

Related posts:

  1. Ubah default password mysql
  2. Error “Invalid Update Control CTF File” ketika update AVG Anti-Virus 8.0
  3. Fatal error: Call to undefined method stdClass::onDisplay()

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Advertiser