Hello, I need set MySQL query limit per hour and max_user_connections with creation MySQL user by ISPCONFIG. Is it possible? Thank you!!!
This should be possible but you will have to change the code of the mysql plugin that creates the user to set these additional parameters.
The plugins are in /usr/local/ispconfig/server/plugins-available/ There ist just one plugin with mysql in its name.
Till can you check if is it right, please? I´m not sure, if it is right place in source. I use $usage_limit variable for define mysql limits. $usage_limit variable is put two lines down bellow is defined. Code: // Create the database user if database is active if($data['new']['active'] == 'y') { if($data['new']['remote_access'] == 'y') { $this->process_host_list('GRANT', $data['new']['database_name'], $data['new']['database_user'], $data['new']['database_password'], $data['new']['remote_ips'], $link); } $usage_limit = 'WITH MAX_QUERIES_PER_HOUR 100000 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 10'; $db_host = 'localhost'; mysql_query("GRANT ALL ON `".str_replace(array('_','%'),array('\\_','\\%'),mysql_real_escape_string($data['new']['database_name'],$link))."`.* TO '".mysql_real_escape_string($data['new']['database_user'],$link)."'@'$db_host' IDENTIFIED BY PASSWORD '".mysql_real_escape_string($data['new']['database_password'],$link)."' ".$usage_limit.";",$link); }