king71 发表于 2019-1-27 09:20:43

sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot ope

  安装编译完后sysbench后,报错。
  报错信息:
  # sysbench -v
  sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
  

  解决方法:
  1、
  # ls -l /usr/local/mysql/lib/libmysqlclient.so.18*
  lrwxrwxrwx. 1 mysql mysql 24 Aug 13 19:16 /usr/local/mysql/lib/libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
  -rwxr-xr-x.1 mysql mysql 6892140 Aug 13 19:16/usr/local/mysql/lib/libmysqlclient.so.18.0.0
  文件是存在的,使用软链接连接下;
  # ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/
  此时测试是否可以,如果不可以进行第二步。
  2、
  # vi /etc/ld.so.conf
  在末尾加上:export LD_LIBRARY_PATH=/usr/local/mysql/lib    mysql的安装目录。
  # ldconfig
  

  # sysbench -v
  Unknown command: -v.
  Usage:
  sysbench ... --test= ... command
  

  General options:
  --num-threads=N            number of threads to use
  --max-requests=N         limit for total number of requests
  --max-time=N               limit for total execution time in seconds
  --forced-shutdown=STRING   amount of time to wait after --max-time before forcing shutdown
  --thread-stack-size=SIZE   size of stack per thread
  --tx-rate=N                target transaction rate (tps)
  --tx-jitter=N            target transaction variation, in microseconds
  --report-interval=N      periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports
  --test=STRING            test to run
  --debug=         print more debugging info
  --validate=      perform validation checks where possible
  --help=            print help and exit
  --version=         print version and exit
  --rand-init=       initialize random number generator
  --rand-type=STRING         random numbers distribution {uniform,gaussian,special}
  --rand-spec-iter=N         number of iterations used for numbers generation
  --rand-spec-pct=N          percentage of values to be treated as 'special' (for special distribution)
  --rand-spec-res=N          percentage of 'special' values to use (for special distribution)
  --rand-seed=N            seed for random number generator, ignored when 0
  

  Log options:
  --verbosity=N      verbosity level {5 - debug, 0 - only critical messages}
  

  --percentile=N      percentile rank of query response times to count
  

  Compiled-in tests:
  fileio - File I/O test
  cpu - CPU performance test
  memory - Memory functions speed test
  threads - Threads subsystem performance test
  mutex - Mutex performance test
  

  Commands: prepare run cleanup help version
  

  See 'sysbench --test= help' for a list of options for each test.
  

  

  此时基本可以确定问题解决。
  

  

  

  。



页: [1]
查看完整版本: sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot ope