msyqldump导出sql
mysqldump -u dbuser -p dbname users> dbname_users.sql
mysql导出csv
mysql -hdbhost -uuser -ppassword -e "select group\_code,company\_type,is\_delete,concat(char(34),company\_name,char(34)) as company\_name from liexin\_basic\_resources.lie\_company where is_delete=1" |sed -e "s/\\t/,/g" -e "s/NULL/ /g" -e "s/\\n/\\r\\n/g" > /tmp/company.csv
注意,里面有段concat(char(34),company_name,char(34)) 是用于给字段拼接双引号的,这样可以避免csv乱码