我试图为MySQL服务器的IP地址授予权限。我不知道怎么能完全因为我的英语而这么说,所以请耐心等待。
xx.xxx.xxx.xx - 我的IP
CREATE USER 'root'@'xx.xxx.xxx.xx' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'root@xx.xxx.xxx.xx' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
我得到了这个错误:
#1227 - Access denied; you need the CREATE USER privilege for this operation
有人可以帮我吗?
修改
我发了命令
SHOW GRANTS;
Grants for sukup-parkety@localhost
GRANT USAGE ON *.* TO 'sukup-parkety'@'localhost' IDENTIFIED BY PASSWORD 'somepassword'
GRANT ALL PRIVILEGES ON `sukup\_parkety`.* TO 'sukup-parkety'@'localhost' WITH GRANT OPTION
EDIT2: 好的,所以我做了其他命令
GRANT ALL ON sukup_parkety.* TO 'root@xx.xxx.xxx.xx' IDENTIFIED BY 'mypassword';
但它报告长度错误?
#1470 - String 'root@xx.xxx.xxx.xx' is too long for user name (should be no longer than 16)
答案 0 :(得分:3)
尝试root' @' xx.xxx.xxx.xx'而不是' root@xx.xxx.xxx.xx'
答案 1 :(得分:0)
是,要授予的确切查询是:
GRANT ALL ON sukup_parkety.* TO 'root'@'xx.xxx.xxx.xx' IDENTIFIED BY 'mypassword';
重复已经说过并希望upvote。