Commit 767c208e by Stijn Tintel Committed by Stijn Tintel

Fix MySQL 5.6 compatibility

In MySQL 5.6, the root account created by default during MySQL
installation has the PROXY ... WITH GRANT OPTION privilege for ''@'',
that is, for all users.

The mysql_user module tries to revoke this privilege, but this fails:
_mysql_exceptions.ProgrammingError: (1064, "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 '''@'' FROM 'root'@'localhost''
at line 1")

Quick fix: don't revoke privilege if user is root and the privilege to
revoke contains PROXY.
parent 1fd863cf
...@@ -153,8 +153,9 @@ def user_mod(cursor, user, host, password, new_priv): ...@@ -153,8 +153,9 @@ def user_mod(cursor, user, host, password, new_priv):
# the new specification, then revoke all privileges on it. # the new specification, then revoke all privileges on it.
for db_table, priv in curr_priv.iteritems(): for db_table, priv in curr_priv.iteritems():
if db_table not in new_priv: if db_table not in new_priv:
privileges_revoke(cursor, user,host,db_table) if user != "root" and "PROXY" not in priv:
changed = True privileges_revoke(cursor, user,host,db_table)
changed = True
# If the user doesn't currently have any privileges on a db.table, then # If the user doesn't currently have any privileges on a db.table, then
# we can perform a straight grant operation. # we can perform a straight grant operation.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment