How to feed mysql queries from bash

后端 未结 7 1185
小鲜肉
小鲜肉 2020-12-05 17:52

I\'m trying to make a bash script that creates a mysql user and database but I can\'t find a way to feed the sql into mysql, I\'m trying with this format:

my         


        
相关标签:
7条回答
  • 2020-12-05 18:20
    mysql --batch --silent -e 'SHOW TABLES';
    

    Batch and silent are handy if you are planning to pipe the output

    0 讨论(0)
提交回复
热议问题