Import data from CSV to MySQL.

To import this data go to command line and connect to mysql with user has all administrative permission set.

> mysql –u USERNAME –h HOSTNAME –p DATABASENAME

This will prompt you to enter password and log you in to mysql terminal.

To import data make sure your csv is at user profile folder and make sure you have TABLE structure on databases and have same name of columns you trying to import from  CSV. Changed the HTML character in command.

Then try this

Load data local INFILE “filename.csv” into table TABLENAME fields terminated by ‘,’ lines terminated by ‘n’ ;

Share

Leave a Reply

Your email address will not be published. Required fields are marked *