瀏覽代碼

fice mysql create db script

Bachir Soussi Chiadmi 5 年之前
父節點
當前提交
591989992b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bin/mysql-db.sh

+ 1 - 1
bin/mysql-db.sh

@@ -46,7 +46,7 @@ _passwd="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c16)"
 # create zabbix mysql user
 mysql -u root -p$_root_mysql_passwd -e "CREATE DATABASE $db_name;"
 mysql -u root -p$_root_mysql_passwd -e "CREATE USER '$db_name'@'localhost' IDENTIFIED BY '$_passwd';"
-mysql -u root -p$_root_mysql_passwd -e "GRANT USAGE ON '$db_name'.* TO '$db_name'@'localhost';"
+mysql -u root -p$_root_mysql_passwd -e "GRANT USAGE ON $db_name.* TO '$db_name'@'localhost';"
 
 mysql -u root -p$_root_mysql_passwd -e "show databases;"