记录,方便以后使用
# shell file
user=$1
password=$2
database=$3
mysql -e 'drop user if exists '$user'@localhost;'
mysql -e 'CREATE USER '$user'@localhost IDENTIFIED BY "'$password'";'
mysql -e 'GRANT ALL PRIVILEGES ON "'$database'".* TO "'$user'"@localhost;'
mysql -e 'flush privileges;'
mysql $database < database.sql