MYSQL differs in Output from script

前端 未结 2 1321
小鲜肉
小鲜肉 2021-01-02 22:52

I have a problem with the MySQL output formatting while executing the commands from a bash script.

If I execute a command on the command line then, I am able to get

相关标签:
2条回答
  • 2021-01-02 23:29

    If you want to have --table option enabled by default when calling mysql program, please check this SO answer How to store MySQL results to a file in table format.

    0 讨论(0)
  • 2021-01-02 23:33

    Pass the -t or --table option to force table output.

    mysql --table -u dbclient -pxxxx GEKONYLOGDB -e "select now(),max(time_stamp) from metrics"
    

    From mysql --help:

      -t, --table         Output in table format.
    
    0 讨论(0)
提交回复
热议问题