I'm trying to follow this tutorial.

It does not give Mysql version requirements. So I'd tried to use Mysql 8.0.18 Community Server to connect to using those commands.

I've created what have been required inside of Mysql 8:

mysql> CREATE SCHEMA sbtest;
mysql> CREATE USER sbtest@'%' IDENTIFIED BY 'MyPassword+1';
mysql> GRANT ALL PRIVILEGES ON sbtest.* to sbtest@'%';

Than created script file with the first command:

[root@host ~]# cat sbpreparing
docker run \
--rm=true \
--name=sb-prepare \
severalnines/sysbench \
sysbench \
--db-driver=mysql \
--oltp-table-size=100000 \
--oltp-tables-count=24 \
--threads=1 \
--mysql-host= \
--mysql-port=3306 \
--mysql-user=sbtest \
--mysql-password=MyPassword+1 \
/usr/share/sysbench/tests/include/oltp_legacy/parallel_prepare.lua \

and launched it:

[root@host ~]# ./sbpreparing
sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Initializing worker threads...

Threads started!

thread prepare0
Creating table 'sbtest1'...
FATAL: unable to connect to MySQL server on host '', port 3306, aborting...
FATAL: error 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/x86_64-linux-gnu/mariadb18/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
FATAL: `thread_run' function failed: /usr/share/sysbench/tests/include/oltp_legacy/common.lua:66: Failed to connect to the database
Error in my_thread_global_end(): 1 threads didn't exit

I could connect to the MySQL server from the same machine using command:

mysql -h -u sbtest -pMyPassword+1

But sysbench couldn't. How could I fix it? Thank you!

  • 1
    this might help – mustaccio Oct 31 '19 at 17:32
  • Yes, it helped, Thank you! You could answer using that approved answer and I will approve it because of it solves this question issue. – Gryu Oct 31 '19 at 17:57
  • 1
    You can self-answer too, providing the exact details of what you did. – mustaccio Oct 31 '19 at 18:36

With the help of mustaccio I've resolved the issue by following instructions in this answer:

  1. Removed a comment sign before the next string in /etc/my.cnf:


  2. Connected as root:

    mysql -u root -pMyPassword+1

  3. Executed the next query:

    ALTER USER 'sbtest'@'%' IDENTIFIED WITH mysql_native_password BY 'MyPassword+1';

After following these instructions Sysbench successfully connected to Mysql 8 and executed all preparation tasks successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.