Create mysql database and user in bash script

后端 未结 4 1855
半阙折子戏
半阙折子戏 2020-12-23 16:52

This seems like it should be simple and I swear this code has worked for months but it\'s not working now. I\'m sure I\'m just overly tired but I would appreciate a knowing

4条回答
  •  一个人的身影
    2020-12-23 17:23

    mysql -uroot -p$*PASSWORD_OF_MYSQL_ROOT_USER* -e "CREATE DATABASE $MAINDB"
    mysql -uroot -p$*PASSWORD_OF_MYSQL_ROOT_USER* -e "GRANT ALL PRIVILEGES ON $MAINDB.* TO $MAINDB@localhost IDENTIFIED BY '$PASSWDDB!'"
    

    This will work for you.

提交回复
热议问题