## 5.7.28 - terminal 1 bin/mysql -uroot -S /tmp/mysql_ushastry.sock -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.28 MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE USER 'ushastry'@'localhost' WITH MAX_USER_CONNECTIONS 10; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL ON test.* TO 'ushastry'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> show create user 'ushastry'@'localhost'\G *************************** 1. row *************************** CREATE USER for ushastry@localhost: CREATE USER 'ushastry'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE WITH MAX_USER_CONNECTIONS 10 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK 1 row in set (0.00 sec) mysql> create database test; Query OK, 1 row affected (0.00 sec) mysql> - terminal 2 - use newly created user bin/mysql -uushastry -hlocalhost --port=3333 --protocol=tcp Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.28 MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \s -------------- bin/mysql Ver 14.14 Distrib 5.7.28, for linux-glibc2.12 (x86_64) using EditLine wrapper Connection id: 3 Current database: Current user: ushastry@localhost SSL: Cipher in use is ECDHE-RSA-AES128-GCM-SHA256 Current pager: more Using outfile: '' Using delimiter: ; Server version: 5.7.28 MySQL Community Server (GPL) Protocol version: 10 Connection: localhost via TCP/IP Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 TCP port: 3333 Uptime: 1 min 26 sec Threads: 2 Questions: 10 Slow queries: 0 Opens: 111 Flush tables: 1 Open tables: 104 Queries per second avg: 0.116 -------------- mysql> ^^ Don't disconnect, leave this as is connected - terminal 3 bin/mysqlslap -uushastry -S/tmp/mysql_ushastry.sock --concurrency=500 --iterations=200 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) ^C - terminal 1 mysql> ALTER USER IF EXISTS 'ushastry'@'localhost' WITH MAX_USER_CONNECTIONS 999; Query OK, 0 rows affected (0.01 sec) mysql> show create user 'ushastry'@'localhost'\G *************************** 1. row *************************** CREATE USER for ushastry@localhost: CREATE USER 'ushastry'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE WITH MAX_USER_CONNECTIONS 999 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK 1 row in set (0.00 sec) - terminal 3 bin/mysqlslap -uushastry -S/tmp/mysql_ushastry.sock --concurrency=500 --iterations=200 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) bin/mysqlslap: Error when connecting to server: 1226 User 'ushastry' has exceeded the 'max_user_connections' resource (current value: 10) . -- terminal 1 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> show create user 'ushastry'@'localhost'\G *************************** 1. row *************************** CREATE USER for ushastry@localhost: CREATE USER 'ushastry'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE WITH MAX_USER_CONNECTIONS 999 PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK 1 row in set (0.00 sec) - terminal 3 bin/mysqlslap -uushastry -S/tmp/mysql_ushastry.sock --concurrency=500 --iterations=200 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test Benchmark Average number of seconds to run all queries: 0.695 seconds Minimum number of seconds to run all queries: 0.645 seconds Maximum number of seconds to run all queries: 1.142 seconds Number of clients running queries: 500 Average number of queries per client: 0