谁能告诉我为什么在运行命令后会出现此错误?
root@server1:/home# ./dbcreate.sh db_team1 team1 team1password
ERROR 1133 (42000) at line 1: Can't find any matching row in the user table
这是我正在使用的脚本。
#!/bin/bash
MYSQL=`which mysql`
ROOTPASSWD=mypassword
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="SET PASSWORD FOR '$2'@'localhost'= PASSWORD('$3');"
Q3="GRANT ALL PRIVILEGES ON $1.* TO '$2'@'localhost' IDENTIFIED BY '$3';"
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
# Usage: $0 dbname dbuser dbpass"
$MYSQL -u root -p$ROOTPASSWD -e "$SQL"