The mysqlslap utility is a diagnostic program that has designed to emulate client load for a MySQL server and report the timing of every stage. It works as though multiple clients are accessing the server.
mysqlslap can be invoked using the below command −
shell> mysqlslap [options]
Some options are: --create or --query that would enable the user to specify a string that contains an SQL statement or a file containing statements.
mysqlslap runs in three stages. They are −
Create schema, table, and any stored programs or data to use (it is optional) for the test. This stage uses a single client connection.
Run the load test. This stage can use multiple client connections.
Clean up, i.e disconnect, drop table if specified. This stage uses a single client connection.
This utility supports the following options, and they can be specified on the command line or in the [mysqlslap] and [client] groups of an option file.
It is the file or string that contains the statement to be executed before running the tests. This execution is not counted for timing purposes.
It is the string that is used to execute using system() before running the tests. This execution is not counted for timing purposes.
It is used to print the program name and all options that it receives from option files.
--query=value, -q value
It is the file or string containing the SELECT statement that needs to be used to retrieve data.
It sets the SQL mode for the client session.