Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 15th January 2013, 12:26
czdavid czdavid is offline
Member
 
Join Date: Aug 2008
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL query limit per hour with database user creation

Hello,

I need set MySQL query limit per hour and max_user_connections with creation MySQL user by ISPCONFIG. Is it possible?

Thank you!!!
Reply With Quote
Sponsored Links
  #2  
Old 15th January 2013, 12:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 15th January 2013, 12:35
czdavid czdavid is offline
Member
 
Join Date: Aug 2008
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
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.
Thank you! Where I can find part of code which I have to change?
Reply With Quote
  #4  
Old 15th January 2013, 13:50
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

The plugins are in /usr/local/ispconfig/server/plugins-available/ There ist just one plugin with mysql in its name.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 15th January 2013, 13:54
czdavid czdavid is offline
Member
 
Join Date: Aug 2008
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
The plugins are in /usr/local/ispconfig/server/plugins-available/ There ist just one plugin with mysql in its name.
Thank you Till. You are very helpful
Reply With Quote
  #6  
Old 15th January 2013, 23:58
czdavid czdavid is offline
Member
 
Join Date: Aug 2008
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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);

				
			}
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Database Replication With SSL Encryption pebkac General 7 10th November 2012 19:12
ISPConfig 3 - MultiServer Setup - With Dedicated Control Panel - How? SuperJC Installation/Configuration 4 16th October 2012 20:03
My Server Is Sending Spam. How Do I Block This? LordJ Server Operation 1 7th July 2011 19:34
MySQL Master-Master guimnk Server Operation 0 24th May 2011 16:15
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58


All times are GMT +2. The time now is 02:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.