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

k2arahey  于 2021-06-25  发布在  Mysql
关注(0)|答案(1)|浏览(359)

当我将这个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$%’);
sbtkgmzw

sbtkgmzw1#

我不确定您运行的是哪个版本的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%';

相关问题