我正在努力学习这教程。
它不提供Mysql版本要求。因此,我尝试使用MySQL8.0.18 Community来连接到使用这些命令。
我在Mysql 8中创建了所需的内容:
mysql> CREATE SCHEMA sbtest;
mysql> CREATE USER sbtest@'%' IDENTIFIED BY 'MyPassword+1';
mysql> GRANT ALL PRIVILEGES ON sbtest.* to sbtest@'%';而不是使用第一个命令创建脚本文件:
[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并启动了该系统:
[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我可以使用命令从同一台机器连接到MySQL服务器:
mysql -h 192.168.1.200 -u sbtest -pMyPassword+1但塞斯莱克不行。我怎么能修好它?谢谢!
发布于 2019-10-31 19:07:15
在胡子的帮助下,我按照这答案中的说明解决了这个问题:
/etc/my.cnf:default_authentication_plugin=mysql_native_password中下一个字符串之前的注释符号mysql -u root -pMyPassword+1ALTER USER 'sbtest'@'%' IDENTIFIED WITH mysql_native_password BY 'MyPassword+1';遵循这些指令之后,Sysbench成功地连接到Mysql 8,并成功地执行了所有准备任务。
https://dba.stackexchange.com/questions/252313
复制相似问题