MySQL查询无法运行,但未显示错误

时间:2018-01-14 11:36:24

标签: mysql sql moodle

当我将此SQL代码段输入 phpMyadmin 时,没有任何反应,并且不会返回任何错误消息。

我该怎么做才能解决它?

CREATE DATABASE `moodle` 
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER ‘moodle-owner’@’localhost’; 
CREATE USER ‘moodle-owner’@’127.0.0.1’;
CREATE USER ‘moodle-owner’@’::1′;

SET PASSWORD FOR ‘moodle-owner’@’localhost’ = PASSWORD(‘moodle123$%’);
SET PASSWORD FOR ‘moodle-owner’@’127.0.0.1’ = PASSWORD(‘moodle123$%’);
SET PASSWORD FOR ‘moodle-owner’@’::1′ = PASSWORD(‘moodle123$%’);

1 个答案:

答案 0 :(得分:0)

我不确定您运行的是哪个版本的MySQL,但在5.7中,不推荐使用SET PASSWORD。尝试在与IDENTIFIED BY相同的查询中使用CREATE USER设置用户密码。

CREATE USER 'moodle-owner'@'localhost' IDENTIFIED BY 'moodle123%'; 
CREATE USER 'moodle-owner'@'127.0.0.1' IDENTIFIED BY 'moodle123%';
CREATE USER 'moodle-owner'@'::1' IDENTIFIED BY 'moodle123%';