Bug #64737 Can not remove User Account
Submitted: 22 Mar 2012 15:10 Modified: 24 May 2012 22:59
Reporter: Jeff Gao Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:5.2.38 CE (Revision 8753) OS:Microsoft Windows (Windows 7 64)
Assigned to: CPU Architecture:Any

[22 Mar 2012 15:10] Jeff Gao
Description:
In Server Management/Security/Users and Privileges, tab Server Access Management, an user is listed in User Accounts list:
  User=bjeff, From Host=bctdw7jeffewc

1. Select the user bjeff, click Button Remove, click Remove on the confirmation dialog, the item bjeff is gone from the User Accounts list.
  The button Apply is grayed, so there is no way to "apply" the change. I assume the change is applied automatically by the system. 
  But click on Refresh, the user comes back to the list again. Or click away from Users and Privileges tab, and comes back to the tab, the user comes back again to the list.

2. If I select the user bjeff, and click Reovoke All Privileges button, click Revoke to confirm, I get the error:
  Unhandled exception: Error executing 'REMOVE ALL PRIVILIGES, GRANT OPTION FROM
'bjeff'@'bctdw7jeffewc'
  There is no such grant defined for user 'bjeff' on host 'bctdw7jeffewc'.
  SQL Error: 1141.
Click OK on the error. The use still in the list.

So I have no way to remove this user.

   
   

How to repeat:
So description.
[22 Mar 2012 15:47] Rafael Antonio Bedoy Torres
Hello Jeff,

Thanks for your report, can you please add more information about your environment? I can't reproduce your bug so far.

On Workbench click on Help -> System Info and paste here the info you get.

Thanks in Advance!
[22 Mar 2012 15:58] Jeff Gao
Here the log:

Exception happened during processing of request from ('127.0.0.1', 53499)
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\SocketServer.py", line 641, in __init__
    self.finish()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\Python\Lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 10054] An existing connection was forcibly closed by the remote host
----------------------------------------
WMIShell: Set filters for local windows cli
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_security.py", line 764, in revoke_all
    self._selected_user.revoke_all()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_security_be.py", line 598, in revoke_all
    self._owner.ctrl_be.exec_sql(command)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_control.py", line 775, in exec_sql
    raise edb_utils.QueryError: Error executing 'REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'bjeff'@'BCTDW7JEFFREWC''
There is no such grant defined for user 'bjeff' on host 'bctdw7jeffrewc'.

SQL Error: 1141

Traceback (most recent call last):

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_security.py", line 764, in revoke_all

    self._selected_user.revoke_all()

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_security_be.py", line 598, in revoke_all

    self._owner.ctrl_be.exec_sql(command)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_control.py", line 775, in exec_sql

    raise e

db_utils.QueryError: Error executing 'REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'bjeff'@'BCTDW7JEFFREWC''

There is no such grant defined for user 'bjeff' on host 'bctdw7jeffrewc'.

SQL Error: 1141
[22 Mar 2012 19:33] Miguel Solorzano
I couldn't repeat on Windows 7 64-bits too.
[22 Mar 2012 19:52] Jeff Gao
Note that I could not recreate the issue either: that is, if I create an new user, I can successfully remove it. The issue exists only for this existing user. 

I guess it is possible that the Mysql workbench crashed during an operation on the User Accounts (e.g., Remove Privileges on the user), and the system is left with an inconsistent states. 

If we have a way to remove the user manually (e.g., use SQL), we can workaround this issue.
[23 Mar 2012 15:59] Alfredo Kojima
Can you run select * from mysql.user where user='bjeff'  and paste the output?
[29 Mar 2012 14:19] Jeff Gao
Sure. Here is the result:

Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,Create_tablespace_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject,max_questions,max_updates,max_connections,max_user_connections,plugin,authentication_string
<host>,bjeff,*<passwd>,Y,Y,Y,Y,Y,Y,Y,Y,Y,N,Y,N,Y,Y,Y,Y,Y,Y,N,N,N,Y,Y,Y,Y,N,Y,Y,N,,NULL,NULL,NULL,0,0,0,0,,NULL

I edited the host and password for privacy.
[24 Apr 2012 22:59] Miguel Solorzano
Please try version 5.2.39. Thanks.
[25 May 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".