Skip to main content
10 events
when toggle format what by license comment
May 18, 2018 at 9:28 comment added SN Palita Sorry it's my mistake. For query mysql -p -t -e "select * from mm_cash " DBname2<< It's work however it a table format. Here is sample result +----+------------+------+ | id | amtf | week | +----+------------+------+ | 1 | 214150.00 | 50 | | 2 | 256950.00 | 50 | However, I need to bulkinsert this file into SQL Server. I think this format cannot bulk into SQL Server
May 18, 2018 at 9:00 comment added Gianluca Mereu What isn't working? the last command? What version of mysql client are you using? Check the corresponding flag with mysql -h. Mine says: "-t, --table Output in table format".
May 18, 2018 at 8:52 comment added Gianluca Mereu I don't think it's possible to change the delimeter. But you can try the -t parameter: mysql -p -t --silent -e "select * from mm_cash " DBname2
May 18, 2018 at 8:03 comment added SN Palita Yes,that's what i am looking for,Thank a lot.The last issue,Could you please advice for this query mysql -p --silent -e "select * from mm_cash " DBname2, I need to seperated field by using '|'.Now it's tap.I google and found --fields-terminated-by but it doesn't work.mysql -h -u -p -e "select * from table" databasename --fields-terminated-by='|' --lines-terminated-by='\n'> D:\test.txt
May 18, 2018 at 4:59 comment added Gianluca Mereu Something like this ? mysql -p --silent -e "select * from mm_cash " DBname2
May 18, 2018 at 4:45 comment added SN Palita Thanks,it's work.By the way,Please advice if I would like file that contains only column header and data. Please see this script mysqldump --host=111.111.1.1 --column-statistics=0 --skip-triggers --extended-insert --compact --no-create-info --skip-lock-tables --user=fakeusesr --password=fakepas --where="true limit 100" DBname2 mm_cash > D:\test.txt
May 18, 2018 at 4:36 vote accept SN Palita
May 18, 2018 at 4:36 vote accept SN Palita
May 18, 2018 at 4:36
May 18, 2018 at 3:09 review First posts
May 18, 2018 at 3:11
May 18, 2018 at 3:08 history answered Gianluca Mereu CC BY-SA 4.0