MySQL data export and import

MySQL data export and import


mysqlimport command for each file that matches the pattern /path/to/database/files/*.txt. If you are in the directory the files are in, you could make the command shorter by doing this:

for filename in `ls -1 *.txt`;
  do mysqlimport -u [username] -p[password] [database] `pwd`/$filename;
done

credits : http://www.electrictoolbox.com/restore-data-tab-delimited-file-mysql/

No comments:

Post a Comment