首页 > 技术文章 > MariaDB [(none)]> drop user cr; ERROR 1396 (HY000): Operation DROP USER failed for 'cr'@'%'

flyingcr 2018-07-04 09:09 原文

  • 首先查看mysql.user表中是否存在该用户


  • 如果存在,更新权限
MariaDB [(none)]> flush privileges;
  • 重新执行删除操作(注意删除的时候要写全称)
MariaDB [(none)]> drop user 'cr'@'localhost';
  • 查看用户表
MariaDB [(none)]> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

推荐阅读