Loading Data
The following procedure uses the MySQL database as an example. The operations are similar for MariaDB and Percona.
- Log in to the MySQL database.
1/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
- Create a sysbench database.
1 2 3 4
create database sysbench; show databases; use sysbench; show tables;
- Log in to the Sysbench client and import test data to the database. The test data is 100 tables x 1,000,000 rows of data.
- For Sysbench 0.5, run the following command:
1/home/sysbench-0.5/sysbench/sysbench --db-driver=mysql --test=/home/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua --oltp-test-mode=complex --mysql-host=192.168.222.120 --mysql-port=3306 --mysql-db=sysbench --mysql-user=root --mysql-password=123456 --max-time=7200 --max-requests=0 --mysql-table-engine=innodb --oltp-table-size=1000000 --oltp-tables-count=100 --rand-type=special --rand-spec-pct=100 --num-threads=60 prepare
- For Sysbench 1.0, run the following command:
1/home/sysbench-1.0/src/sysbench --db-driver=mysql --mysql-host=192.168.222.120 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --mysql-db=sysbench --table_size=1000000 --tables=100 --time=180 --threads=96 --report-interval=10 oltp_read_write prepare
- For Sysbench 0.5, run the following command:
Parent topic: Running