要么是你上面函数的参数给错了,要么是指定IP那个机器的MYSQL数据库服务没有启动。
官方说明:
use of GRANT to define nonprivilege characteristics is deprecated as of MySQL 5.7.6. Instead, perform this task using CREATE USER or ALTER USER.
参考:
http://dev.mysql.com/doc/refman/5.7/en/grant.html
网上再看了一些文章, 应该是grant不要用于创建用户和用户信息的修改, 用户固有信息的修改使用alert user语法, 权限的赋予和回收, 只用grant和revoke, 两者不建议有交集, 比如你的grant后又加了identified, 实际上是做了重新分配密码(用户固有信息)的事情.
尝试下写成这样:
create 'sonar'@'%' identified by 'sonar'grant all privileges on sonar.* to 'sonar'@'%'
应该不会报这个异常.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)