- 首先查看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;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> drop user 'cr'@'localhost';
MariaDB [(none)]> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;