Search code examples
mysqlmysqlimport

load data into the table into remote server from local machine


I have a table in database on the remote server. I want to populate the data into the that table from the local machine. I have the csv file in the local machine which has data that needs to be uploaded data into the table of remote server.

Please suggest me how can do it through mysqlimport and from where should I execute.

Thanks in advance.


Solution

  • Use LOAD DATA to solve this problem. Find example below:

    LOAD DATA LOCAL INFILE 'filename'
    INTO TABLE `tablename`
    FIELDS TERMINATED BY ','
    LINES TERMINATED BY '\r\n' (`column_name`)