D
dman_2007
Guest
Mysql server ships with a handy utility program called mysqlimport which can be used for importing data into your mysql database. It is specially useful for importing large amount of data which can be difficult to import with phpmyadmin due to restriction in max file size upload allowed or script execution time. Here's the basic syntax :
various options specfiy how the data is to be imported, db_name specifes the database name into which the data is to be imported and textfile1 etc. after removing the file extension part is used to find out the table names which will populated with the imported data.
Apart from usual options such as -u, -h, -p which are used to specify how to connect to the mysql server, following are the major options which can be used :
1) --columns=column_list, -c column_list
Used to specify the comma separated list of table data columns. Order of the table data column names should match the order of data columns in the data file.
2) --compress, -C
Use compression while communicatng, if both the client and server support compression.
Will discuss more options in my next post.
mysqlimport [options] db_name textfile1 ...
various options specfiy how the data is to be imported, db_name specifes the database name into which the data is to be imported and textfile1 etc. after removing the file extension part is used to find out the table names which will populated with the imported data.
Apart from usual options such as -u, -h, -p which are used to specify how to connect to the mysql server, following are the major options which can be used :
1) --columns=column_list, -c column_list
Used to specify the comma separated list of table data columns. Order of the table data column names should match the order of data columns in the data file.
2) --compress, -C
Use compression while communicatng, if both the client and server support compression.
Will discuss more options in my next post.