当我将此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$%’);
答案 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%';