How to run mysql query in shell script
Following script can select data from MySQL and save to CSV. $mysql_bin -u xxx -pxxx dbname
Following script can select data from MySQL and save to CSV. $mysql_bin -u xxx -pxxx dbname
shell> mysqlimport [options] db_name textfile1 [textfile2 …]
When runing MySQL in Linux, the latin_1 charset will be the default when you create new database. But we always need UTF-8 as the default charset in our database, so that the below configration will help you made the process smooth. character-set-server=utf8 default-collation=utf8_unicode_ci