在CentOS7上模拟使用dbt2 tpc-c测试(未成功)&&为vm虚拟机加装硬盘&&解决secure-file-priv o问题&&解决(OS errno 13 - Permission denied)

给虚拟机加装硬盘
//虚拟机➡设置➡硬盘➡添加

[root@localhost ~]# fdisk /dev/sdb        //新硬盘分区
欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。

Device does not contain a recognized partition table
使用磁盘标识符 0xba4452ac 创建新的 DOS 磁盘标签。

命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
分区号 (1-4,默认 1):1
起始 扇区 (2048-41943039,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-41943039,默认为 41943039):
将使用默认值 41943039
分区 1 已设置为 Linux 类型,大小设为 20 GiB

命令(输入 m 获取帮助):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
正在同步磁盘。
[root@localhost ~]# fdisk -l             //查看分区

磁盘 /dev/sda:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x000a2638

   设备 Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    41943039    19921920   8e  Linux LVM

磁盘 /dev/sdb:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0xba4452ac

   设备 Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    41943039    20970496   83  Linux

磁盘 /dev/mapper/centos-root:18.2 GB, 18249416704 字节,35643392 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-swap:2147 MB, 2147483648 字节,4194304 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost ~]# mkfs -t ext3 /dev/sdb1      //格式化新硬盘,可以格式化为ext4
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242624 blocks
262131 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成   

[root@localhost ~]# mount /dev/sdb1  /home/q/data30            //把新硬盘挂载到/home/q/data30下

[root@localhost ~]# blkid                                      // 查看新硬盘的UUID
/dev/sda1: UUID="9fc9400e-9f56-4ece-8ef1-558aacfa79d5" TYPE="xfs"
/dev/sda2: UUID="1qy9k5-Hcqs-I069-jA2R-Dx1L-Y63Y-2Ll6AF" TYPE="LV
/dev/sdb1: UUID="664b377a-5cae-4e1f-9a0f-023369ef02bf" TYPE="ext3
/dev/mapper/centos-root: UUID="6c95e28c-1a85-4279-92ab-52f0a1a28d 
/dev/mapper/centos-swap: UUID="6f6a3e25-a2fb-4b1c-bdb9-0c16d9418e" 

[root@localhost src]# vim /etc/fstab                           //设置开机自动挂载
//添加这一行:UUID=664b377a-5cae-4e1f-9a0f-023369ef02bf /home/q/data30 ext3 defaults 0 0
//                                                      挂载点     文件系统类型 挂载选项 是否备份 是否检测 
[root@localhost src]#  mount -a                                 // 挂载全部

[root@localhost src]#  df -h                                     // 查看

[root@localhost mysql]# shutdown -r now                          //重启

 

secure-file-priv
[root@localhost mysql]# vim /etc/my.cnf
//在[MySQL]下查找secure-file-priv='',如果没有自己添加

[root@localhost mysql]# systemctl restart mysqld   //重启MySQL服务

[root@localhost mysql]# mysql -uroot -p'密码'      
mysql> show variables like '%secure_file_priv%';     //查看secure-file-priv=''参数的值
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| secure_file_priv |       |
+------------------+-------+
1 row in set (0.01 sec)

mysql> 

解决(OS errno 13 - Permission denied)&&LOAD DATA LOCAL INFILE file request rejected due to restrictions on access两个问题
mysql> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| benchmarker        |
| dbt2               |
| information_schema |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
| test               |
+--------------------+
8 rows in set (0.00 sec)

mysql> show tables;
+----------------+
| Tables_in_dbt2 |
+----------------+
| customer       |
| district       |
| history        |
| item           |
| new_order      |
| order_line     |
| orders         |
| stock          |
| warehouse      |
+----------------+
9 rows in set (0.00 sec)

mysql> show variables like 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | OFF   |
+---------------+-------+
1 row in set (0.00 sec)

mysql> set global local_infile=on;      //允许从本地加载
Query OK, 0 rows affected (0.00 sec)

[root@localhost mysql]# chmod 777 /home/q/data1/customer.data

[root@localhost mysql]# vim build_db.sh                               //这里开始是解决ERROR 2068 (HY000) 
command_exec "$MYSQL $DB_NAME --local-infile -e \"LOAD DATA LOCAL $LOCAL LOCAL INFILE \\\"$DB_PATH/$FN.data\\\" \
                INTO TABLE $TABLE FIELDS TERMINATED BY '\t'\""                    //找到这一行,添加‘--local-infile’和’LOCAL’
//仔细看会发现这一段可以登录MySQL后手动输入完成。

模拟使用dbt2 TPC-C进行基准测试
dbt2的下载地址:[https://sourceforge.net/projects/osdldbt/files/dbt2/](https://sourceforge.net/projects/osdldbt/files/dbt2/)

主机下载后使用XFtp上传到虚拟机

//接下来的操作需要提前配置好per环境
[root@localhost ~]# cpan Statistics::Descriptive &&  cpan Test:Parser  &&   cpan Test::Reporter
CPAN: Storable loaded ok (v2.45)
Reading '/root/.local/share/.cpan/Metadata'
  Database was generated on Tue, 26 Mar 2024 15:54:08 GMT
CPAN: Module::CoreList loaded ok (v2.76_02)
Statistics::Descriptive is up to date (3.0801).
CPAN: Storable loaded ok (v2.45)
Reading '/root/.local/share/.cpan/Metadata'
  Database was generated on Tue, 26 Mar 2024 15:54:08 GMT
CPAN: Module::CoreList loaded ok (v2.76_02)
Test::Parser is up to date (1.7).
CPAN: Storable loaded ok (v2.45)
Reading '/root/.local/share/.cpan/Metadata'
  Database was generated on Tue, 26 Mar 2024 15:54:08 GMT
CPAN: Module::CoreList loaded ok (v2.76_02)
Test::Reporter is up to date (1.62).

[root@localhost ~]#  tar-xzf dbt2-0.40.tar.gz
[root@localhost dbt2-0.40]#  cd dbt2-0.40
[root@localhost dbt2-0.40]# ./configure --prefix=/root/dbt2-0.40 --with-mysql=/usr --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib64/mysql    //找对应文件路径,mysql_config、mysql.h、libmysqlclient.so 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking for grep... /usr/bin/grep
checking for vmstat... /usr/bin/vmstat
checking for iostat... /usr/bin/iostat
checking for gnuplot... no
configure: WARNING: *** gnuplot not found some scripts may not be usable
checking for sar... /usr/bin/sar
checking for sysctl... /usr/sbin/sysctl
checking for rsync... /usr/bin/rsync
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... (cached) /usr/bin/grep
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking semaphore.h usability... yes
checking semaphore.h presence... yes
checking for semaphore.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for sem_init in -lposix4... no
checking for main in -lm... yes
checking for library containing socket... none required
checking for library containing gethostbyname... none required
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for library containing getopt_long... none required
checking for deflate in -lz... yes
checking Version of MySQL headers... 80300
checking MySQL C flags(custom)... -I/usr/include/mysql
checking MySQL linker flags(custom)... -L/usr/lib64/mysql -lmysqlclient
checking for mysql_config... /usr/bin/mysql_config
checking for MySQL libraries... checking for mysql... /usr/bin/mysql
checking for mysqld_safe... /usr/bin/mysqld_safe
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for vprintf... yes
checking for _doprnt... no
checking for gettimeofday... yes
checking for socket... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
configure: creating ./config.status
config.status: creating scripts/Linux/get_os_info.sh
config.status: creating scripts/mysql/build_db.sh
config.status: creating scripts/mysql/mysql_profile
config.status: creating scripts/mysql/start_db.sh
config.status: creating scripts/mysql/stop_db.sh
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating storedproc/Makefile
config.status: creating scripts/dbt2_profile
config.status: creating scripts/sysstats.sh
config.status: creating scripts/transform_sar.sh
config.status: creating scripts/run_workload.sh
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

[root@localhost dbt2-0.40]#  make & make install
make  all-recursive
make[1]: 进入目录“/root/dbt2-0.40”
Making all in .
make[2]: 进入目录“/root/dbt2-0.40”
make[2]: 离开目录“/root/dbt2-0.40”
Making all in src
make[2]: 进入目录“/root/dbt2-0.40/src”
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-client.o `test -f 'client.c' || echo './'`client.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-transaction_queue.o `test -f 'transaction_queue.c' || echo './'`transaction_queue.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-listener.o `test -f 'listener.c' || echo './'`listener.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-db_threadpool.o `test -f 'db_threadpool.c' || echo './'`db_threadpool.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-db.o `test -f 'db.c' || echo './'`db.c
db.c: 在函数‘db_init’中:
db.c:69:6: 警告:变量‘rc’被设定但未被使用 [-Wunused-but-set-variable]
  int rc;
      ^
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-common.o `test -f 'common.c' || echo './'`common.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-logging.o `test -f 'logging.c' || echo './'`logging.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-_socket.o `test -f '_socket.c' || echo './'`_socket.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-client_interface.o `test -f 'client_interface.c' || echo './'`client_interface.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-transaction_data.o `test -f 'transaction_data.c' || echo './'`transaction_data.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-_semaphore.o `test -f '_semaphore.c' || echo './'`_semaphore.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_common.o `test -f 'mysql/dbc_common.c' || echo './'`mysql/dbc_common.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_new_order.o `test -f 'nonsp/dbc_new_order.c' || echo './'`nonsp/dbc_new_order.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_payment.o `test -f 'nonsp/dbc_payment.c' || echo './'`nonsp/dbc_payment.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_order_status.o `test -f 'nonsp/dbc_order_status.c' || echo './'`nonsp/dbc_order_status.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_delivery.o `test -f 'nonsp/dbc_delivery.c' || echo './'`nonsp/dbc_delivery.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_stock_level.o `test -f 'nonsp/dbc_stock_level.c' || echo './'`nonsp/dbc_stock_level.c
nonsp/dbc_stock_level.c: 在函数‘stock_level’中:
nonsp/dbc_stock_level.c:45:6: 警告:变量‘low_stock’被设定但未被使用 [-Wunused-but-set-variable]
  int low_stock = 0;
      ^
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_integrity.o `test -f 'nonsp/dbc_integrity.c' || echo './'`nonsp/dbc_integrity.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o client-dbc_nonsp.o `test -f 'nonsp/dbc_nonsp.c' || echo './'`nonsp/dbc_nonsp.c
gcc -I/usr/include/mysql -m64  -Wall -g -O2 -L/usr/lib64/mysql -lmysqlclient -lpthread -ldl  -lssl  -lcrypto -lresolv -lm -lrt  -o client client-client.o client-transaction_queue.o client-listener.o client-db_threadpool.o client-db.o client-common.o client-logging.o client-_socket.o client-client_interface.o client-transaction_data.o client-_semaphore.o client-dbc_common.o client-dbc_new_order.o client-dbc_payment.o client-dbc_order_status.o client-dbc_delivery.o client-dbc_stock_level.o client-dbc_integrity.o client-dbc_nonsp.o  -lz -lm -lpthread 
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude    -Wall -g -O2 -c datagen.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude    -Wall -g -O2 -c common.c
gcc  -Wall -g -O2 -lm -lpthread  -o datagen datagen.o common.o  -lz -lm -lpthread 
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-driver_main.o `test -f 'driver_main.c' || echo './'`driver_main.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-driver.o `test -f 'driver.c' || echo './'`driver.c
driver.c: 在函数‘integrity_terminal_worker’中:
driver.c:136:6: 警告:变量‘length’被设定但未被使用 [-Wunused-but-set-variable]
  int length;
      ^
driver.c: 在函数‘terminal_worker’中:
driver.c:400:6: 警告:变量‘length’被设定但未被使用 [-Wunused-but-set-variable]
  int length;
      ^
driver.c:445:14: 警告:此函数中的‘junk’在使用前可能未初始化 [-Wmaybe-uninitialized]
   local_seed ^=  tid ^ tv.tv_sec ^ tv.tv_usec ^ junk;
              ^
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-input_data_generator.o `test -f 'input_data_generator.c' || echo './'`input_data_generator.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-common.o `test -f 'common.c' || echo './'`common.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-logging.o `test -f 'logging.c' || echo './'`logging.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-_socket.o `test -f '_socket.c' || echo './'`_socket.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-client_interface.o `test -f 'client_interface.c' || echo './'`client_interface.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-transaction_data.o `test -f 'transaction_data.c' || echo './'`transaction_data.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o driver-_semaphore.o `test -f '_semaphore.c' || echo './'`_semaphore.c
gcc -I/usr/include/mysql -m64  -Wall -g -O2 -L/usr/lib64/mysql -lmysqlclient -lpthread -ldl  -lssl  -lcrypto -lresolv -lm -lrt  -o driver driver-driver_main.o driver-driver.o driver-input_data_generator.o driver-common.o driver-logging.o driver-_socket.o driver-client_interface.o driver-transaction_data.o driver-_semaphore.o  -lz -lm -lpthread 
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-transaction_test.o `test -f 'transaction_test.c' || echo './'`transaction_test.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-db.o `test -f 'db.c' || echo './'`db.c
db.c: 在函数‘db_init’中:
db.c:69:6: 警告:变量‘rc’被设定但未被使用 [-Wunused-but-set-variable]
  int rc;
      ^
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-input_data_generator.o `test -f 'input_data_generator.c' || echo './'`input_data_generator.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-common.o `test -f 'common.c' || echo './'`common.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-logging.o `test -f 'logging.c' || echo './'`logging.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-_socket.o `test -f '_socket.c' || echo './'`_socket.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-client_interface.o `test -f 'client_interface.c' || echo './'`client_interface.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-transaction_data.o `test -f 'transaction_data.c' || echo './'`transaction_data.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-_semaphore.o `test -f '_semaphore.c' || echo './'`_semaphore.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_common.o `test -f 'mysql/dbc_common.c' || echo './'`mysql/dbc_common.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_new_order.o `test -f 'nonsp/dbc_new_order.c' || echo './'`nonsp/dbc_new_order.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_payment.o `test -f 'nonsp/dbc_payment.c' || echo './'`nonsp/dbc_payment.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_order_status.o `test -f 'nonsp/dbc_order_status.c' || echo './'`nonsp/dbc_order_status.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_delivery.o `test -f 'nonsp/dbc_delivery.c' || echo './'`nonsp/dbc_delivery.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_stock_level.o `test -f 'nonsp/dbc_stock_level.c' || echo './'`nonsp/dbc_stock_level.c
nonsp/dbc_stock_level.c: 在函数‘stock_level’中:
nonsp/dbc_stock_level.c:45:6: 警告:变量‘low_stock’被设定但未被使用 [-Wunused-but-set-variable]
  int low_stock = 0;
      ^
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_integrity.o `test -f 'nonsp/dbc_integrity.c' || echo './'`nonsp/dbc_integrity.c
gcc -DHAVE_CONFIG_H -I. -I.. -Iinclude   -I/usr/include/mysql -m64  -Wall -g -O2 -c -o transaction_test-dbc_nonsp.o `test -f 'nonsp/dbc_nonsp.c' || echo './'`nonsp/dbc_nonsp.c
gcc -I/usr/include/mysql -m64  -Wall -g -O2 -L/usr/lib64/mysql -lmysqlclient -lpthread -ldl  -lssl  -lcrypto -lresolv -lm -lrt  -o transaction_test transaction_test-transaction_test.o transaction_test-db.o transaction_test-input_data_generator.o transaction_test-common.o transaction_test-logging.o transaction_test-_socket.o transaction_test-client_interface.o transaction_test-transaction_data.o transaction_test-_semaphore.o transaction_test-dbc_common.o transaction_test-dbc_new_order.o transaction_test-dbc_payment.o transaction_test-dbc_order_status.o transaction_test-dbc_delivery.o transaction_test-dbc_stock_level.o transaction_test-dbc_integrity.o transaction_test-dbc_nonsp.o  -lz -lm -lpthread 
make[2]: 离开目录“/root/dbt2-0.40/src”
Making all in storedproc
make[2]: 进入目录“/root/dbt2-0.40/storedproc”
make[3]: 进入目录“/root/dbt2-0.40/storedproc”
make[3]: 对“all-am”无需做任何事。
make[3]: 离开目录“/root/dbt2-0.40/storedproc”
make[2]: 离开目录“/root/dbt2-0.40/storedproc”
make[1]: 离开目录“/root/dbt2-0.40”
Making install in .
make[1]: 进入目录“/root/dbt2-0.40”
make[2]: 进入目录“/root/dbt2-0.40”
make[2]: 对“install-exec-am”无需做任何事。
make[2]: 对“install-data-am”无需做任何事。
make[2]: 离开目录“/root/dbt2-0.40”
make[1]: 离开目录“/root/dbt2-0.40”
Making install in src
make[1]: 进入目录“/root/dbt2-0.40/src”
make[2]: 进入目录“/root/dbt2-0.40/src”
test -z "/root/dbt2-0.40/bin" || /usr/bin/mkdir -p "/root/dbt2-0.40/bin"
  /usr/bin/install -c 'client' '/root/dbt2-0.40/bin/client'
  /usr/bin/install -c 'datagen' '/root/dbt2-0.40/bin/datagen'
  /usr/bin/install -c 'driver' '/root/dbt2-0.40/bin/driver'
  /usr/bin/install -c 'transaction_test' '/root/dbt2-0.40/bin/transaction_test'
make[2]: 对“install-data-am”无需做任何事。
make[2]: 离开目录“/root/dbt2-0.40/src”
make[1]: 离开目录“/root/dbt2-0.40/src”
Making install in storedproc
make[1]: 进入目录“/root/dbt2-0.40/storedproc”
make[2]: 进入目录“/root/dbt2-0.40/storedproc”
make[3]: 进入目录“/root/dbt2-0.40/storedproc”
make[3]: 对“install-exec-am”无需做任何事。
make[3]: 对“install-data-am”无需做任何事。
make[3]: 离开目录“/root/dbt2-0.40/storedproc”
make[2]: 离开目录“/root/dbt2-0.40/storedproc”
make[1]: 离开目录“/root/dbt2-0.40/storedproc”


[root@localhost dbt2-0.40]#  ./src/datagen -w 1 -d /home/q/data1 --mysql
warehouses = 1
districts = 10
customers = 3000
items = 100000
orders = 3000
stock = 100000
new_orders = 900

Output directory of data files: /home/q/data1

Generating data files for 1 warehouse(s)...
Generating item table data...
Finished item table data...
Generating warehouse table data...
Finished warehouse table data...
Generating stock table data...
Finished stock table data...
Generating district table data...
Finished district table data...
Generating customer table data...
Finished customer table data...
Generating history table data...
Finished history table data...
Generating order and order-line table data...
Finished order and order-line table data...
Generating new-order table data...
Finished new-order table data...

[root@localhost dbt2-0.40]# cd scripts/mysql
[root@localhost mysql]# ./build_db.sh -d dbt2 -f /home/q/data1 -s /var/lib/mysql/mysql.sock -h localhost -u root -p'密码'

Loading of DBT2 dataset located in /home/q/data1 to database dbt2.

DB_ENGINE:      INNODB
DB_SCHEME:      OPTIMIZED
DB_HOST:        localhost
DB_USER:        root
DB_SOCKET:      /var/lib/mysql/mysql.sock

Creating table STOCK
Creating table ITEM
Creating table ORDER_LINE
Creating table ORDERS
Creating table NEW_ORDER
Creating table HISTORY
Creating table CUSTOMER
Creating table DISTRICT
Creating table WAREHOUSE

Loading table customer
ERROR 1300 (HY000) at line 1: Invalid utf8mb4 character string: '4W+'   //这里有问题
ERROR: rc=1
SCRIPT INTERRUPTED

DBT2使用说明
MySQL import csv file ERROR 13 (HY000): Can't get stat of /path/file.csv (Errcode: 2)

posted @ 2024-03-28 04:00  碰这么难  阅读(2)  评论(0编辑  收藏  举报