Dockerized Sysbench could not connect to Mysql 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&gt; CREATE SCHEMA sbtest;
mysql&gt; CREATE USER sbtest@'%' IDENTIFIED BY 'MyPassword+1';
mysql&gt; 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=192.168.1.200 \
--mysql-port=3306 \
--mysql-user=sbtest \
--mysql-password=MyPassword+1 \
/usr/share/sysbench/tests/include/oltp_legacy/parallel_prepare.lua \
run


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 '192.168.1.200', 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 192.168.1.200 -u sbtest -pMyPassword+1


But sysbench couldn't. How could I fix it? Thank you!
With the help of mustaccio I've resolved the issue by following instructions in this answer:


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

default_authentication_plugin=mysql_native_password
Connected as root:

mysql -u root -pMyPassword+1
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.