diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-05-14 23:21:15 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:53:31 +0200 |
commit | 9606090f1c334445151808cc12b2f4dbdcedb39b (patch) | |
tree | 47f77c70cc5a4e215704d00f65fa61a372ac0050 /lib/modules/mysql_user | |
parent | c54977c7c1b580225dd6499bd5770bb0945ff9a5 (diff) |
typo
Diffstat (limited to 'lib/modules/mysql_user')
-rw-r--r-- | lib/modules/mysql_user | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/modules/mysql_user b/lib/modules/mysql_user index 64e1f3d..054698e 100644 --- a/lib/modules/mysql_user +++ b/lib/modules/mysql_user @@ -135,41 +135,41 @@ password=n<_665{vS43y import ConfigParser import getpass import tempfile try: import MySQLdb except ImportError: mysqldb_found = False else: mysqldb_found = True # =========================================== # MySQL module specific support methods. # def user_exists(cursor, user, host): cursor.execute("SELECT count(*) FROM user WHERE user = %s AND host = %s", (user,host)) count = cursor.fetchone() return count[0] > 0 def load_plugin(cursor, plugin): - cursor.execute("SELECT count(*) FROM plugin WHERE name = %s", plugin) + cursor.execute("SELECT count(*) FROM information_schema.plugins WHERE name = %s", plugin) count = cursor.fetchone() if count[0] == 0: so = "%s.so" % plugin cursor.execute("INSTALL PLUGIN %s SONAME %s", (plugin, so)) def user_add(cursor, user, host, password, new_priv, auth_plugin): if password is None: # Automatically loaded on first first use. load_plugin(cursor, auth_plugin) cursor.execute("CREATE USER %s@%s IDENTIFIED WITH %s", (user,host,auth_plugin)) else: cursor.execute("CREATE USER %s@%s IDENTIFIED BY %s", (user,host,password)) if new_priv is not None: for db_table, priv in new_priv.iteritems(): privileges_grant(cursor, user,host,db_table,priv) return True def user_mod(cursor, user, host, password, new_priv, append_privs, auth_plugin): changed = False grant_option = False |