mysql - MySQL授权语法错误
问题描述
您好我尝试运行此 SQL 查询:
grant all on `mch`.* to 'admin'@'localhost' identified by '123456';
但它抱怨:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by '123456'' at line 1
解决方案
根据您使用的版本,不再允许这样做。
从 MySQL 5.7.2 开始,如果帐户已经存在,则禁止使用 IDENTIFIED WITH,因为它仅用于创建新帐户时使用。
推荐阅读
- python-3.x - aws 胶水主要丢弃空字段
- javascript - JavaScript:将对象属性中的每个单词缩短为固定长度?
- mysql - 当我添加表中已存在的产品时,数量值未在数据库中更新
- intellij-idea - 我可以为 IntelliJ 中的 Project Pane -> Changed Files 视图使用模块结构(折叠 Java 包路径)吗?
- mysql - Count(*) 按月分组,如果月计数为 0,则值为 0
- ruby-on-rails - Rails 5.2 简单更新方法的语法错误
- windows - 静态构建中缺少 Qt 应用程序资源
- php - 在 wp_query 中分别列出每个自定义帖子类型,而不重复循环
- javascript - 如何防止内容在初始页面加载时被移动浏览器的状态栏向上推送和隐藏?
- python - 如何从字典列表转换为字典?