Killall before dropping mysql databases/users.
This commit is contained in:
parent
c031f5004c
commit
90350b0ca0
@ -56,6 +56,7 @@ public class MySqlDatabaseProcessorFactory implements EntityProcessorFactory {
|
|||||||
String aName = AbstractEntity.escapeString(db.getName());
|
String aName = AbstractEntity.escapeString(db.getName());
|
||||||
String aOwner = AbstractEntity.escapeString(db.getOwner());
|
String aOwner = AbstractEntity.escapeString(db.getOwner());
|
||||||
aJDBCP.addSQL("REVOKE ALL ON " + aName + ".* FROM '" + aOwner + "'@'%'");
|
aJDBCP.addSQL("REVOKE ALL ON " + aName + ".* FROM '" + aOwner + "'@'%'");
|
||||||
|
aJDBCP.addSQL("CALL mysql.kill_by_database('" + aName + "');");
|
||||||
aJDBCP.addSQL("DROP DATABASE IF EXISTS " + aName);
|
aJDBCP.addSQL("DROP DATABASE IF EXISTS " + aName);
|
||||||
return aJDBCP;
|
return aJDBCP;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class MySqlUserProcessorFactory implements EntityProcessorFactory {
|
|||||||
JDBCProcessor aJDBCP = MySqlDatabaseProcessorFactory.createMySqlAdminProcessor();
|
JDBCProcessor aJDBCP = MySqlDatabaseProcessorFactory.createMySqlAdminProcessor();
|
||||||
String aName = AbstractEntity.escapeString(dbu.getName());
|
String aName = AbstractEntity.escapeString(dbu.getName());
|
||||||
aJDBCP.addSQL("REVOKE ALL PRIVILEGES, GRANT OPTION FROM '" + aName + "'@'%'");
|
aJDBCP.addSQL("REVOKE ALL PRIVILEGES, GRANT OPTION FROM '" + aName + "'@'%'");
|
||||||
|
aJDBCP.addSQL("CALL mysql.kill_by_user('" + aName + "');");
|
||||||
aJDBCP.addSQL("DROP USER '" + aName + "'@'%'");
|
aJDBCP.addSQL("DROP USER '" + aName + "'@'%'");
|
||||||
return aJDBCP;
|
return aJDBCP;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user