3

I have created a user named sbtest, with no password, with all rights on sbtest, and the following error occurs. What am I doing wrong?

$ sysbench --test=oltp run --debug
sysbench 0.4.12:  multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
DEBUG: mysql_init(0xc854f0)
DEBUG: mysql_real_connect(0xc854f0, "localhost", "sbtest", "(null)", "sbtest", 3306, "(null)", CLIENT_MULTI_STATEMENTS)
DEBUG: mysql_real_query(0xc854f0, "SHOW TABLE STATUS LIKE 'sbtest'", 31) = 0
DEBUG: mysql_store_result(0xc854f0) = 0xc9dce0
DEBUG: mysql_num_fields(0xc9dce0) = 18
DEBUG: mysql_fetch_fields(0xc9dce0) = 0xc9fce0
DEBUG: mysql_fetch_row(0xc9dce0) = (nil)
ALERT: Error: failed to determine table 'sbtest' type!
ALERT: MySQL error: 
DEBUG: mysql_free_result(0xc9dce0)
DEBUG: mysql_close(0xc854f0)
FATAL: failed to get database capabilities
Mustafa
  • 205
  • 3
  • 9

2 Answers2

4

You should run "prepare" first. It will create the table required for the benchmark.

In your case, it should be

sysbench --test=oltp prepare

Henry Hu
  • 156
  • 3
  • You are right, but I also need to create user sbtest that has privlleges on database sbtest, however these can be configruable. – Mustafa May 12 '15 at 06:54
2

Create sbtest database and sbtest user.

If you're not going to supply command parameters to the sysbench command then you'll need to create the database and user that it expects when talking with the MySQL server.

Log in to your MySQL server using the root user or whatever you like:

mysql -u root -p

Create sbtest database, sbtest user and grant privileges:

CREATE DATABASE sbtest;
CREATE USER 'sbtest'@'localhost';
GRANT ALL PRIVILEGES ON * . * TO 'sbtest'@'localhost';
FLUSH PRIVILEGES;
quit;

Prepare database:

sysbench --test=oltp --db-driver=mysql prepare