MySQL Forums
Forum List  »  Security

Re: MAX_CONNECTION_PER_HOUR seems have some problem
Posted by: Jay Alverson
Date: February 27, 2009 01:34PM

It works on mine, however I issued FLUSH PRIVILEGES right away...

mysql> 
mysql> #drop user testuser@localhost;
mysql> 
mysql> GRANT ALL on *.* TO testuser@localhost
    -> identified by "mysql"
    -> WITH MAX_CONNECTIONS_PER_HOUR 2;
Query OK, 0 rows affected (0.00 sec)

mysql> 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> 
mysql> notee

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\Program Files\MySQL\bin>mysql -utestuser -pmysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select user();
+--------------------+
| user()             |
+--------------------+
| testuser@localhost |
+--------------------+
1 row in set (0.02 sec)

mysql> exit
Bye

c:\Program Files\MySQL\bin>mysql -utestuser -pmysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select user();
+--------------------+
| user()             |
+--------------------+
| testuser@localhost |
+--------------------+
1 row in set (0.00 sec)

mysql> exit
Bye

c:\Program Files\MySQL\bin>mysql -utestuser -pmysql
ERROR 1226 (42000): User 'testuser' has exceeded the 'max_connections_per_hour'
resource (current value: 2)

c:\Program Files\MySQL\bin>

When I tried another session with MySQL Query Browser I got an error dialog with 1226 as well.

I couldn't get all the other options to work (this is from the help file) I kept
getting errors so I trimmed it down to just the connections spec...

mysql> GRANT ALL ON customer.* TO 'francis'@'localhost'
    ->     IDENTIFIED BY 'frank'
    ->     WITH MAX_QUERIES_PER_HOUR 20
    ->          MAX_UPDATES_PER_HOUR 10
    ->          MAX_CONNECTIONS_PER_HOUR 5
    ->          MAX_USER_CONNECTIONS 2;

>

Thanks, Jay

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MAX_CONNECTION_PER_HOUR seems have some problem
5000
February 27, 2009 01:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.