Check if mysql database exists, perform action based on result

前端 未结 20 2347
傲寒
傲寒 2021-02-01 16:02

Is it possible from within a bash script to check if a mysql database exists. Depending on the result then perform another action or terminate the script?

20条回答
  •  误落风尘
    2021-02-01 16:14

    mysqlshow will not show underscore characters '_' in the database name.

    mysqlshow $DOMAIN %
    

    https://dev.mysql.com/doc/refman/5.1/en/mysqlshow.html

提交回复
热议问题