mysqlslap is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage. It works as if multiple clients are accessing the server. mysqlslap is available as of MySQL 5.1.4.
Invoke mysqlslap like this:
shell> mysqlslap [options]
Some options such as --create or
--query enable you to specify a string
containing an SQL statement or a file containing statements.
If you specify a file, by default it must contain one
statement per line. (That is, the implicit statement delimiter
is the newline character.) Use the
--delimiter to specify different delimiter,
which allows you to specify statements that span multiple
lines or place multiple statements on a single line. You
cannot include comments in a file;
mysqlslap does not understand them.
mysqlslap supports the following options:
Display a help message and exit.
Generate SQL statements automatically when they are not supplied in files or via command options.
Compress all information sent between the client and the server if both support compression.
The number of clients to simulate when issuing the
SELECT statement.
The file or string to use for creating the table.
The schema in which to run the tests. This option was added in MySQL 5.1.5.
Generate output in comma-separated values format. The output goes to the named file, or to the standard output if no file is given. This option was added in MySQL 5.1.5.
--debug[=,
debug_options]-#
[
debug_options]
Write a debugging log. The
debug_options string often is
'd:t:o,.
file_name'
The delimiter to use in SQL statements supplied in files or via command options.
--engine=,
engine_name-e
engine_name
The storage engine to use for creating the table.
--host=,
host_name-h
host_name
Connect to the MySQL server on the given host.
The number of times to run the tests.
The directory to use for storing locks. This option was added in MySQL 5.1.5.
The number of VARCHAR columns to use if
--auto-generate-sql is specified.
The number of INT columns to use if
--auto-generate-sql is specified.
Limit each client to approximately this number of queries. This option was added in MySQL 5.1.5.
Do not connect to databases. mysqlslap only prints what it would have done. This option was added in MySQL 5.1.5.
--password[=,
password]-p[
password]
The password to use when connecting to the server. If you
use the short option form (-p), you
cannot have a space between the
option and the password. If you omit the
password value following the
--password or -p option
on the command line, you are prompted for one.
Specifying a password on the command line should be considered insecure. See Section 5.8.6, “Keeping Your Password Secure”.
The TCP/IP port number to use for the connection.
--protocol={TCP|SOCKET|PIPE|MEMORY}
The connection protocol to use.
Preserve the schema from the mysqlslap run. This option was added in MySQL 5.1.5.
The file or string containing the
SELECT statement to use for retrieving
data.
Silent mode. No output.
Don't run any SELECT statements.
Follow master locks for other mysqlslap
clients. Use this option if you are trying to synchronize
around one master server with
--lock-directory plus NFS. This option
was added in MySQL 5.1.5.
For connections to localhost, the Unix
socket file to use, or, on Windows, the name of the named
pipe to use.
Options that begin with --ssl specify
whether to connect to the server via SSL and indicate
where to find SSL keys and certificates. See
Section 5.8.7.3, “SSL Command Options”.
On Unix, the default is to use fork()
calls. This option causes pthread calls
to be used instead. On Windows, the default is to use
pthread calls and the option has no
effect. This option was added in MySQL 5.1.6.
--user=,
user_name-u
user_name
The MySQL username to use when connecting to the server.
Verbose mode. Print more information about what the program does.
Display version information and exit.

User Comments
Hello, As suggested in a MySql webinar I just got now, I tried to run mysqlslap on a Windows 5.0.18-nt server. It coredumps as soon as it connects to the server. Apparently, mysqlslap only works for 5.1
I can't test for the suggested "may-be works" on 4.1, but I suspect this won't work any better.
Add your own comment.