我正在尝试执行此查询-
DROP DATABASE IF EXISTS `hotel`;
GRANT USAGE ON *.* TO 'user'@'localhost';
DROP USER 'user'@'localhost';
CREATE USER user@localhost IDENTIFIED BY 'user';
CREATE DATABASE `hotel`
CHARACTER SET 'utf8'
COLLATE 'utf8_general_ci';
GRANT USAGE ON *.* to 'user'@'localhost' identified by 'user';
但我总是出错
GRANT USAGE ON *.* TO 'user'@'localhost' Error Code: 1133. Can't find any matching row in the user table 0.000 sec
我认为Grant usage
如果用户不存在则创建新用户。怎么了?