DROP USER user;但是当前用户必须有权限
解决方案 »
- mysql Out of memory (Needed 16771080 bytes)错误 求帮忙
- mysql数据库在用于多线程执行时出现错误,急!!!
- 如何设置才能直接 yum install mysql-server运行安装mysql
- 对于多张结构相同的表,如何实现一个主键
- c访问mysql总报错,请指教
- 请问关于MYSQL多级子查询中表引用的问题
- 关于WHERE语句的问题
- 出售各行各业的解决方案
- 怎么使用uptimize table????
- 1064)您的SQL语法中有错误; 请检查与您的MySQL服务器版本对应的手册,以获取在...
- 想了解PostgreSql ,以前从没听过。
- 还是同步问题。请多多指教
mysql>use mysql;
mysql>delete from user where name='name' and host='host';
只要上述条件能够唯一找到你所要删除的用户而不影响其他用户就可以了。
DELETE FROM mysql.db WHERE Host='localhost' AND User='tmp';
DELETE FROM mysql.tables_priv WHERE Host='localhost' AND User='tmp';
DELETE FROM mysql.columns_priv WHERE Host='localhost' AND User='tmp';
FLUSH PRIVILEGES;如果你的mysql版本较高,可以直接删除用户DROP USER user [, user] ...The DROP USER statement removes one or more MySQL accounts. It removes privilege rows for the account from all grant tables. To use this statement, you must have the global CREATE USER privilege or the DELETE privilege for the mysql database. Each account is named using the same format as for the GRANT statement; for example, 'jeffrey'@'localhost'. The user and host parts of the account name correspond to the User and Host column values of the user table row for the account.With DROP USER, you can remove an account and its privileges as follows:DROP USER user;Important: DROP USER does not automatically close any open user sessions. Rather, in the event that a user with an open session is dropped, the statement does not take effect until that user's session is closed. Once the session is closed, the user is dropped, and that user's next attempt to log in will fail. This is by design.