Archive for the ‘MySQL’ Category

MySQL CSV , Tab separated Data Dump

December 24, 2005

Commonly we use the “mysqldump” tool to generate or backup data. But the standard output of the utility is SQL, or bunch of SQL statements starting from the “CREATE TABLE …” .. to the “INSERT INTO …”

Most of the times we just need a simple CSV or a tab separated data dump. And then we start searching for options, phpMyAdmin.

To get a CSV dump, the mysqldump utility needs some parameters.

mysqldump -T /folder_path –fields-terminated-by=’,’ –fields-enclosed-by='”‘ –lines-terminated-by=’\r\n’ -u root -p database_name table_name

(more…)