龙芯源码编译MySQL

在龙芯+麒麟操作系统环境使用源码编译MySQL5.7.39,其操作步骤如下:
查看是否已安装mariadb,若是已安装,需要卸载

[root@localhost yum.repos.d]# rpm -qa|grep mariadb
mariadb-10.3.9-8.p01.ky10.mips64el
mariadb-common-10.3.9-8.p01.ky10.mips64el
mariadb-errmessage-10.3.9-8.p01.ky10.mips64el
mariadb-connector-c-3.0.6-6.ky10.mips64el
mariadb-server-10.3.9-8.p01.ky10.mips64el

要是有,卸载:# yum remove mariadb

[root@localhost yum.repos.d]# yum remove mariadb
Warning: failed loading '/etc/yum.repos.d/kylin.repo', skipping.
Dependencies resolved.
=================================================================================================================================================================================================
 Package                                         Architecture                              Version                                              Repository                                  Size
=================================================================================================================================================================================================
Removing:
 mariadb                                         mips64el                                  3:10.3.9-8.p01.ky10                                  @anaconda                                   38 M
Removing dependent packages:
 mariadb-server                                  mips64el                                  3:10.3.9-8.p01.ky10                                  @anaconda                                   92 M
Removing unused dependencies:
 perl-DBD-MySQL                                  mips64el                                  4.046-6.ky10                                         @anaconda                                  327 k

Transaction Summary
=================================================================================================================================================================================================
Remove  3 Packages

Freed space: 129 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                         1/1
  Running scriptlet: mariadb-3:10.3.9-8.p01.ky10.mips64el                                                                                                                                    1/1
  Erasing          : mariadb-3:10.3.9-8.p01.ky10.mips64el                                                                                                                                    1/3
  Running scriptlet: mariadb-server-3:10.3.9-8.p01.ky10.mips64el                                                                                                                             2/3
  Erasing          : mariadb-server-3:10.3.9-8.p01.ky10.mips64el                                                                                                                             2/3
  Running scriptlet: mariadb-server-3:10.3.9-8.p01.ky10.mips64el                                                                                                                             2/3
  Erasing          : perl-DBD-MySQL-4.046-6.ky10.mips64el                                                                                                                                    3/3
  Running scriptlet: perl-DBD-MySQL-4.046-6.ky10.mips64el                                                                                                                                    3/3
  Verifying        : mariadb-3:10.3.9-8.p01.ky10.mips64el                                                                                                                                    1/3
  Verifying        : mariadb-server-3:10.3.9-8.p01.ky10.mips64el                                                                                                                             2/3
  Verifying        : perl-DBD-MySQL-4.046-6.ky10.mips64el                                                                                                                                    3/3

Removed:
  mariadb-3:10.3.9-8.p01.ky10.mips64el                         mariadb-server-3:10.3.9-8.p01.ky10.mips64el                         perl-DBD-MySQL-4.046-6.ky10.mips64el

Complete!

[root@localhost soft]# mkdir /mnt/cdrom
[root@localhost soft]# mount -o loop -t iso9660 Kylin-Server-10-SP1-Release-Build18-20210809-mips64el.iso /mnt/cdrom
mount: /mnt/cdrom: WARNING: source write-protected, mounted read-only.
[root@localhost soft]# cd /mnt/cdrom
[root@localhost cdrom]# ls
boot  boot.catalog  EFI  images  LICENSE  manual  Packages  repodata  TRANS.TBL

[root@localhost yum.repos.d]# cat kylin.repo
[ks10-local-iso]
name = Kylin Linux Advanced Server 10 - local
baseurl = file:///mnt/cdrom/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 1

(2)下载源码包并解压

# wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.29.tar.gz
# tar -zxvf mysql-5.7.29.tar.gz

(3)yum安装编译所需要的工具和库

# yum install gcc gcc-c++ cmake ncurses-devel bison openssl-devel rpcgen

上面的软件要一个一个安装,一起可能有问题

[root@localhost yum.repos.d]# yum -y install gcc* gcc-c++ ncurses* ncurses-devel* cmake* bison* libgcrypt* perl* make* openssl-devel* rpcgen*
Last metadata expiration check: 0:01:56 ago on 2022年11月15日 星期二 23时22分05秒.
Package gcc-8.3.1-4.5.p03.ky10.mips64el is already installed.
Package ncurses-6.1-14.ky10.mips64el is already installed.
Package ncurses-base-6.1-14.ky10.noarch is already installed.
Package ncurses-libs-6.1-14.ky10.mips64el is already installed.
Package cmake-3.12.1-5.ky10.mips64el is already installed.
Package cmake-data-3.12.1-5.ky10.noarch is already installed.
Package cmake-filesystem-3.12.1-5.ky10.mips64el is already installed.
Package cmake-help-3.12.1-5.ky10.noarch is already installed.
Package cmake-rpm-macros-3.12.1-5.ky10.noarch is already installed.
Package libgcrypt-1.8.3-5.ky10.mips64el is already installed.
Package perl-4:5.28.0-434.ky10.mips64el is already installed.
Package perl-Algorithm-Diff-1.1903-14.ky10.noarch is already installed.
Package perl-Algorithm-Diff-help-1.1903-14.ky10.noarch is already installed.
Package perl-Archive-Tar-2.30-421.ky10.noarch is already installed.
Package perl-Authen-SASL-help-2.16-16.ky10.noarch is already installed.
Package perl-B-Debug-1.26-4.ky10.noarch is already installed.
Package perl-B-Debug-help-1.26-4.ky10.noarch is already installed.
Package perl-Business-ISBN-Data-help-20191107-2.ky10.noarch is already installed.
Package perl-Business-ISBN-help-3.005-1.ky10.noarch is already installed.
Package perl-CGI-help-4.46-1.ky10.noarch is already installed.
Package perl-CPAN-Meta-2.150010-419.ky10.noarch is already installed.
Package perl-CPAN-Meta-Requirements-2.140-419.ky10.noarch is already installed.
Package perl-CPAN-Meta-Requirements-help-2.140-419.ky10.noarch is already installed.
Package perl-CPAN-Meta-YAML-0.018-420.ky10.noarch is already installed.
Package perl-CPAN-Meta-YAML-help-0.018-420.ky10.noarch is already installed.
Package perl-CPAN-Meta-help-2.150010-419.ky10.noarch is already installed.
Package perl-Capture-Tiny-help-0.48-4.ky10.noarch is already installed.
Package perl-Carp-1.50-418.ky10.noarch is already installed.
Package perl-Carp-help-1.50-418.ky10.noarch is already installed.
Package perl-Class-Inspector-help-1.32-5.ky10.noarch is already installed.
Package perl-Class-Method-Modifiers-help-2.12-12.ky10.noarch is already installed.
Package perl-Class-XSAccessor-help-1.19-18.ky10.noarch is already installed.
Package perl-Compress-Bzip2-help-2.26-10.ky10.noarch is already installed.
Package perl-Compress-Raw-Bzip2-2.081-8.ky10.mips64el is already installed.
Package perl-Compress-Raw-Bzip2-help-2.081-8.ky10.noarch is already installed.
Package perl-Compress-Raw-Zlib-2.081-6.ky10.mips64el is already installed.
Package perl-Compress-Raw-Zlib-help-2.081-6.ky10.noarch is already installed.
Package perl-Config-General-help-2.63-1.ky10.noarch is already installed.
Package perl-Config-Perl-V-0.30-5.ky10.noarch is already installed.
Package perl-Config-Perl-V-help-0.30-5.ky10.noarch is already installed.
Package perl-Crypt-OpenSSL-Random-help-0.15-4.ky10.noarch is already installed.
Package perl-Crypt-PasswdMD5-help-1.4.0-14.ky10.noarch is already installed.
Package perl-DBD-MySQL-help-4.046-6.ky10.mips64el is already installed.
Package perl-DBD-SQLite-1.58-4.ky10.mips64el is already installed.
Package perl-DBD-SQLite-help-1.58-4.ky10.mips64el is already installed.
Package perl-DBI-1.642-2.ky10.mips64el is already installed.
Package perl-DBI-help-1.642-2.ky10.noarch is already installed.
Package perl-DB_File-1.842-2.ky10.mips64el is already installed.
Package perl-DB_File-help-1.842-2.ky10.noarch is already installed.
Package perl-Data-Dumper-2.172-3.ky10.mips64el is already installed.
Package perl-Data-Dumper-help-2.172-3.ky10.noarch is already installed.
Package perl-Data-Section-help-0.200007-6.ky10.noarch is already installed.
Package perl-Date-Calc-help-6.4-12.ky10.noarch is already installed.
Package perl-Devel-CheckLib-help-1.13-5.ky10.noarch is already installed.
Package perl-Devel-GlobalDestruction-help-0.14-8.ky10.noarch is already installed.
Package perl-Devel-PPPort-3.42-4.ky10.mips64el is already installed.
Package perl-Devel-PPPort-help-3.42-4.ky10.noarch is already installed.
Package perl-Devel-Size-help-0.82-4.ky10.noarch is already installed.
Package perl-Digest-1.17-419.ky10.noarch is already installed.
Package perl-Digest-MD5-2.55-419.ky10.mips64el is already installed.
Package perl-Digest-MD5-help-2.55-419.ky10.noarch is already installed.
Package perl-Digest-SHA-1:6.02-7.ky10.mips64el is already installed.
Package perl-Digest-SHA-help-1:6.02-7.ky10.noarch is already installed.
Package perl-Digest-SHA3-help-1.04-4.ky10.mips64el is already installed.
Package perl-Digest-help-1.17-419.ky10.noarch is already installed.
Package perl-Encode-4:2.98-9.ky10.mips64el is already installed.
Package perl-Encode-Locale-help-1.05-12.ky10.noarch is already installed.
Package perl-Encode-devel-4:2.98-9.ky10.mips64el is already installed.
Package perl-Encode-help-4:2.98-9.ky10.noarch is already installed.
Package perl-Env-1.04-397.ky10.noarch is already installed.
Package perl-Env-help-1.04-397.ky10.noarch is already installed.
Package perl-Error-1:0.17026-4.ky10.noarch is already installed.
Package perl-Error-help-1:0.17026-4.ky10.noarch is already installed.
Package perl-Exporter-5.73-420.ky10.noarch is already installed.
Package perl-Exporter-Tiny-help-1.002001-5.ky10.noarch is already installed.
Package perl-Exporter-help-5.73-420.ky10.noarch is already installed.
Package perl-ExtUtils-Command-1:7.42-2.ky10.noarch is already installed.
Package perl-ExtUtils-Config-help-0.008-19.ky10.noarch is already installed.
Package perl-ExtUtils-Helpers-0.026-13.ky10.noarch is already installed.
Package perl-ExtUtils-Install-2.14-419.ky10.noarch is already installed.
Package perl-ExtUtils-Install-help-2.14-419.ky10.noarch is already installed.
Package perl-ExtUtils-InstallPaths-help-0.012-9.ky10.noarch is already installed.
Package perl-ExtUtils-MakeMaker-1:7.42-2.ky10.noarch is already installed.
Package perl-ExtUtils-MakeMaker-help-1:7.42-2.ky10.noarch is already installed.
Package perl-ExtUtils-Manifest-1:1.71-4.ky10.noarch is already installed.
Package perl-ExtUtils-Manifest-help-1:1.71-4.ky10.noarch is already installed.
Package perl-ExtUtils-ParseXS-2:3.35-1.ky10.noarch is already installed.
Package perl-ExtUtils-ParseXS-help-2:3.35-1.ky10.noarch is already installed.
Package perl-Fedora-VSP-help-0.001-10.ky10.noarch is already installed.
Package perl-File-BaseDir-help-0.08-6.ky10.noarch is already installed.
Package perl-File-DesktopEntry-help-0.22-11.ky10.noarch is already installed.
Package perl-File-Fetch-0.56-4.ky10.noarch is already installed.
Package perl-File-Fetch-help-0.56-4.ky10.noarch is already installed.
Package perl-File-HomeDir-1.004-4.ky10.noarch is already installed.
Package perl-File-HomeDir-help-1.004-4.ky10.noarch is already installed.
Package perl-File-Path-2.16-4.ky10.noarch is already installed.
Package perl-File-Path-help-2.16-4.ky10.noarch is already installed.
Package perl-File-ReadBackwards-help-1.05-1.ky10.noarch is already installed.
Package perl-File-Remove-help-1.58-2.ky10.noarch is already installed.
Package perl-File-ShareDir-Install-help-0.13-4.ky10.noarch is already installed.
Package perl-File-ShareDir-help-1.116-4.ky10.noarch is already installed.
Package perl-File-Slurp-help-9999.19-22.ky10.noarch is already installed.
Package perl-File-Sync-help-0.11-20.ky10.noarch is already installed.
Package perl-File-Temp-1:0.230.800-4.ky10.noarch is already installed.
Package perl-File-Temp-help-1:0.230.800-4.ky10.noarch is already installed.
Package perl-File-Which-1.22-6.ky10.noarch is already installed.
Package perl-File-Which-help-1.22-6.ky10.noarch is already installed.
Package perl-Filter-2:1.59-2.ky10.mips64el is already installed.
Package perl-Filter-Simple-1:0.94-1.ky10.noarch is already installed.
Package perl-Filter-Simple-help-1:0.94-1.ky10.noarch is already installed.
Package perl-Font-TTF-help-1.06-9.ky10.noarch is already installed.
Package perl-GD-Barcode-help-1.15-30.ky10.noarch is already installed.
Package perl-GD-help-2.71-1.p01.ky10.noarch is already installed.
Package perl-GSSAPI-help-0.28-26.ky10.mips64el is already installed.
Package perl-Getopt-Long-2.50-419.ky10.noarch is already installed.
Package perl-Getopt-Long-help-2.50-419.ky10.noarch is already installed.
Package perl-Git-2.27.0-4.ky10.noarch is already installed.
Package perl-HTML-Parser-help-3.72-16.ky10.mips64el is already installed.
Package perl-HTML-Tagset-help-3.20-37.ky10.noarch is already installed.
Package perl-HTTP-Cookies-help-6.04-5.ky10.noarch is already installed.
Package perl-HTTP-Daemon-help-6.01-26.ky10.noarch is already installed.
Package perl-HTTP-Date-help-6.02-21.ky10.noarch is already installed.
Package perl-HTTP-Message-help-6.18-4.ky10.noarch is already installed.
Package perl-HTTP-Negotiate-help-6.01-22.ky10.noarch is already installed.
Package perl-HTTP-Tiny-0.076-3.ky10.noarch is already installed.
Package perl-HTTP-Tiny-help-0.076-3.ky10.noarch is already installed.
Package perl-IO-Compress-2.081-6.ky10.noarch is already installed.
Package perl-IO-Compress-help-2.081-6.ky10.noarch is already installed.
Package perl-IO-HTML-help-1.001-13.ky10.noarch is already installed.
Package perl-IO-Socket-INET6-help-2.72-15.ky10.noarch is already installed.
Package perl-IO-Socket-IP-0.39-420.ky10.noarch is already installed.
Package perl-IO-Socket-IP-help-0.39-420.ky10.noarch is already installed.
Package perl-IO-Socket-SSL-help-2.066-4.ky10.noarch is already installed.
Package perl-IO-stringy-help-2.111-12.ky10.noarch is already installed.
Package perl-IPC-Cmd-2:1.04-4.ky10.noarch is already installed.
Package perl-IPC-Cmd-help-2:1.04-4.ky10.noarch is already installed.
Package perl-IPC-SysV-2.07-5.ky10.mips64el is already installed.
Package perl-IPC-SysV-help-2.07-5.ky10.noarch is already installed.
Package perl-IPC-System-Simple-1.25-19.ky10.noarch is already installed.
Package perl-IPC-System-Simple-help-1.25-19.ky10.noarch is already installed.
Package perl-JSON-PP-1:4.04-2.ky10.noarch is already installed.
Package perl-JSON-PP-help-1:4.04-2.ky10.noarch is already installed.
Package perl-JSON-XS-help-1:3.04-6.ky10.noarch is already installed.
Package perl-JSON-help-2.97.001-6.ky10.noarch is already installed.
Package perl-LWP-MediaTypes-help-6.02-17.ky10.noarch is already installed.
Package perl-List-MoreUtils-XS-help-0.428-7.ky10.noarch is already installed.
Package perl-List-MoreUtils-help-0.428-5.ky10.noarch is already installed.
Package perl-Locale-Codes-3.58-2.ky10.noarch is already installed.
Package perl-Locale-Codes-help-3.58-2.ky10.noarch is already installed.
Package perl-Locale-Maketext-1:1.28-1.ky10.noarch is already installed.
Package perl-Locale-Maketext-help-1:1.28-1.ky10.noarch is already installed.
Package perl-MIME-Base64-3.15-418.ky10.mips64el is already installed.
Package perl-MIME-Base64-help-3.15-418.ky10.noarch is already installed.
Package perl-MRO-Compat-help-0.13-9.ky10.noarch is already installed.
Package perl-Math-BigInt-1:1.9998.13-5.ky10.noarch is already installed.
Package perl-Math-BigInt-FastCalc-0.500.700-4.ky10.mips64el is already installed.
Package perl-Math-BigInt-FastCalc-help-0.500.700-4.ky10.noarch is already installed.
Package perl-Math-BigInt-help-1:1.9998.13-5.ky10.noarch is already installed.
Package perl-Math-BigRat-0.2614-2.ky10.noarch is already installed.
Package perl-Math-BigRat-help-0.2614-2.ky10.noarch is already installed.
Package perl-Module-Build-Tiny-help-0.039-17.ky10.noarch is already installed.
Package perl-Module-Build-help-2:0.42.24-12.ky10.noarch is already installed.
Package perl-Module-CoreList-1:5.20180920-2.ky10.noarch is already installed.
Package perl-Module-CoreList-help-1:5.20180920-2.ky10.noarch is already installed.
Package perl-Module-Install-AuthorRequires-help-0.02-18.ky10.noarch is already installed.
Package perl-Module-Install-AuthorTests-help-0.002-18.ky10.noarch is already installed.
Package perl-Module-Install-ReadmeFromPod-help-0.30-12.ky10.noarch is already installed.
Package perl-Module-Install-ReadmeMarkdownFromPod-help-0.04-10.ky10.noarch is already installed.
Package perl-Module-Install-Repository-help-0.06-23.ky10.noarch is already installed.
Package perl-Module-Load-1:0.32-418.ky10.noarch is already installed.
Package perl-Module-Load-Conditional-0.68-418.ky10.noarch is already installed.
Package perl-Module-Load-Conditional-help-0.68-418.ky10.noarch is already installed.
Package perl-Module-Load-help-1:0.32-418.ky10.noarch is already installed.
Package perl-Module-Manifest-Skip-help-0.23-16.ky10.noarch is already installed.
Package perl-Module-Metadata-1.000036-3.ky10.noarch is already installed.
Package perl-Module-Metadata-help-1.000036-3.ky10.noarch is already installed.
Package perl-Module-Package-Au-help-2-16.ky10.noarch is already installed.
Package perl-Module-Package-help-0.30-22.ky10.noarch is already installed.
Package perl-Module-Runtime-help-0.016-5.ky10.noarch is already installed.
Package perl-Module-ScanDeps-help-1.27-6.p01.ky10.noarch is already installed.
Package perl-Moo-help-2.003004-8.ky10.noarch is already installed.
Package perl-Mozilla-CA-help-1:20180117-6.ky10.noarch is already installed.
Package perl-NTLM-help-1.09-20.ky10.noarch is already installed.
Package perl-Net-Daemon-1:0.48-2.ky10.noarch is already installed.
Package perl-Net-Daemon-help-1:0.48-2.ky10.noarch is already installed.
Package perl-Net-HTTP-help-6.18-4.ky10.noarch is already installed.
Package perl-Net-LibIDN-help-0.12-33.ky10.noarch is already installed.
Package perl-Net-SNMP-help-6.0.1-23.ky10.noarch is already installed.
Package perl-Net-SSLeay-help-1.88-5.ky10.noarch is already installed.
Package perl-NetAddr-IP-help-4.079-10.ky10.mips64el is already installed.
Package perl-Package-Constants-help-1:0.06-1.ky10.noarch is already installed.
Package perl-Package-Generator-help-1.106-14.ky10.noarch is already installed.
Package perl-Params-Check-1:0.38-418.ky10.noarch is already installed.
Package perl-Params-Check-help-1:0.38-418.ky10.noarch is already installed.
Package perl-Params-Util-help-1.07-26.ky10.noarch is already installed.
Package perl-Parse-Yapp-help-1.21-5.ky10.noarch is already installed.
Package perl-Path-Class-help-0.37-14.ky10.noarch is already installed.
Package perl-Path-Tiny-help-0.108-2.ky10.noarch is already installed.
Package perl-PathTools-3.75-4.ky10.mips64el is already installed.
Package perl-PathTools-help-3.75-4.ky10.noarch is already installed.
Package perl-Perl-OSType-1.010-421.ky10.noarch is already installed.
Package perl-Perl-OSType-help-1.010-421.ky10.noarch is already installed.
Package perl-PerlIO-via-QuotedPrint-0.08-397.ky10.noarch is already installed.
Package perl-PerlIO-via-QuotedPrint-help-0.08-397.ky10.noarch is already installed.
Package perl-Pod-Checker-4:1.73-398.ky10.noarch is already installed.
Package perl-Pod-Checker-help-4:1.73-398.ky10.noarch is already installed.
Package perl-Pod-Escapes-1:1.07-419.ky10.noarch is already installed.
Package perl-Pod-Escapes-help-1:1.07-419.ky10.noarch is already installed.
Package perl-Pod-Markdown-help-3.101-2.ky10.noarch is already installed.
Package perl-Pod-Parser-1.63-397.ky10.noarch is already installed.
Package perl-Pod-Parser-help-1.63-397.ky10.noarch is already installed.
Package perl-Pod-Perldoc-1:3.28-3.ky10.noarch is already installed.
Package perl-Pod-Perldoc-help-1:3.28-3.ky10.noarch is already installed.
Package perl-Pod-Simple-1:3.35-418.ky10.noarch is already installed.
Package perl-Pod-Simple-help-1:3.35-418.ky10.noarch is already installed.
Package perl-Pod-Usage-4:1.69-418.ky10.noarch is already installed.
Package perl-Pod-Usage-help-4:1.69-418.ky10.noarch is already installed.
Package perl-Readonly-help-2.05-8.ky10.noarch is already installed.
Package perl-Role-Tiny-help-2.001004-2.ky10.noarch is already installed.
Package perl-SGMLSpm-1.03ii-45.ky10.noarch is already installed.
Package perl-SGMLSpm-help-1.03ii-45.ky10.noarch is already installed.
Package perl-SNMP_Session-help-1.13-20.ky10.noarch is already installed.
Package perl-Scalar-List-Utils-3:1.52-2.ky10.mips64el is already installed.
Package perl-Scalar-List-Utils-help-3:1.52-2.ky10.noarch is already installed.
Package perl-Socket-4:2.029-2.ky10.mips64el is already installed.
Package perl-Socket-MsgHdr-help-0.05-5.ky10.noarch is already installed.
Package perl-Socket-help-4:2.029-2.ky10.noarch is already installed.
Package perl-Socket6-help-0.28-9.ky10.mips64el is already installed.
Package perl-Software-License-help-0.103013-7.ky10.noarch is already installed.
Package perl-Storable-1:3.15-2.ky10.mips64el is already installed.
Package perl-Storable-help-1:3.15-2.ky10.noarch is already installed.
Package perl-String-ShellQuote-help-1.04-26.ky10.noarch is already installed.
Package perl-Sub-Exporter-Progressive-help-0.001013-8.ky10.noarch is already installed.
Package perl-Sub-Exporter-help-0.987-18.ky10.noarch is already installed.
Package perl-Sub-Install-help-0.928-18.ky10.noarch is already installed.
Package perl-Sub-Name-help-0.21-10.ky10.mips64el is already installed.
Package perl-Sub-Quote-help-2.005001-4.ky10.noarch is already installed.
Package perl-Sys-CPU-help-0.61-19.ky10.noarch is already installed.
Package perl-Sys-MemInfo-help-0.99-9.ky10.noarch is already installed.
Package perl-Sys-Syslog-0.35-420.ky10.mips64el is already installed.
Package perl-Sys-Syslog-help-0.35-420.ky10.noarch is already installed.
Package perl-Term-ANSIColor-4.06-511.ky10.noarch is already installed.
Package perl-Term-ANSIColor-help-4.06-511.ky10.noarch is already installed.
Package perl-Term-Cap-1.17-510.ky10.noarch is already installed.
Package perl-Term-Cap-help-1.17-510.ky10.noarch is already installed.
Package perl-TermReadKey-2.38-2.ky10.mips64el is already installed.
Package perl-TermReadKey-help-2.38-2.ky10.noarch is already installed.
Package perl-Test-Deep-help-1.128-4.ky10.noarch is already installed.
Package perl-Test-FailWarnings-help-0.008-15.ky10.noarch is already installed.
Package perl-Test-Fatal-help-0.014-13.ky10.noarch is already installed.
Package perl-Test-Harness-1:3.43_01-3.ky10.noarch is already installed.
Package perl-Test-Harness-help-1:3.43_01-3.ky10.noarch is already installed.
Package perl-Test-InDistDir-help-1.112071-10.ky10.noarch is already installed.
Package perl-Test-LeakTrace-help-0.16-10.ky10.noarch is already installed.
Package perl-Test-NoWarnings-help-1.04-17.ky10.noarch is already installed.
Package perl-Test-Pod-Coverage-help-1.10-14.ky10.noarch is already installed.
Package perl-Test-Pod-help-1.52-4.ky10.noarch is already installed.
Package perl-Test-Requires-help-0.10-15.ky10.noarch is already installed.
Package perl-Test-Simple-2:1.302140-3.ky10.noarch is already installed.
Package perl-Test-Simple-help-2:1.302140-3.ky10.noarch is already installed.
Package perl-Text-Balanced-2.03-420.ky10.noarch is already installed.
Package perl-Text-Balanced-help-2.03-420.ky10.noarch is already installed.
Package perl-Text-Diff-1.45-7.ky10.noarch is already installed.
Package perl-Text-Diff-help-1.45-7.ky10.noarch is already installed.
Package perl-Text-Glob-help-0.11-7.ky10.noarch is already installed.
Package perl-Text-ParseWords-3.30-419.ky10.noarch is already installed.
Package perl-Text-ParseWords-help-3.30-419.ky10.noarch is already installed.
Package perl-Text-Tabs+Wrap-2013.0523-419.ky10.noarch is already installed.
Package perl-Text-Tabs+Wrap-help-2013.0523-419.ky10.noarch is already installed.
Package perl-Text-Template-help-1.53-4.ky10.noarch is already installed.
Package perl-Text-WrapI18N-help-0.06-33.ky10.noarch is already installed.
Package perl-Thread-Queue-3.13-3.ky10.noarch is already installed.
Package perl-Thread-Queue-help-3.13-3.ky10.noarch is already installed.
Package perl-Time-HiRes-1.9760-2.ky10.mips64el is already installed.
Package perl-Time-HiRes-help-1.9760-2.ky10.noarch is already installed.
Package perl-Time-Local-2:1.280-6.ky10.noarch is already installed.
Package perl-Time-Local-help-2:1.280-6.ky10.noarch is already installed.
Package perl-TimeDate-help-1:2.30-17.ky10.noarch is already installed.
Package perl-Types-Serialiser-help-1.0-18.ky10.noarch is already installed.
Package perl-URI-help-1.76-3.ky10.noarch is already installed.
Package perl-Unicode-Collate-1.25-4.ky10.mips64el is already installed.
Package perl-Unicode-Collate-help-1.25-4.ky10.noarch is already installed.
Package perl-Unicode-Normalize-1.26-419.ky10.mips64el is already installed.
Package perl-Unicode-Normalize-help-1.26-419.ky10.noarch is already installed.
Package perl-Unicode-UTF8-help-0.62-8.ky10.noarch is already installed.
Package perl-XML-LibXML-help-1:2.0132-5.ky10.mips64el is already installed.
Package perl-XML-NamespaceSupport-help-1.12-7.ky10.noarch is already installed.
Package perl-XML-Parser-1:2.44-3.ky10.mips64el is already installed.
Package perl-XML-Parser-help-1:2.44-3.ky10.noarch is already installed.
Package perl-XML-SAX-Base-help-1.09-7.ky10.noarch is already installed.
Package perl-XML-SAX-help-1.00-5.ky10.noarch is already installed.
Package perl-XML-Writer-help-0.625-14.ky10.noarch is already installed.
Package perl-XML-XPath-help-1.42-6.ky10.noarch is already installed.
Package perl-YAML-Tiny-help-1.73-4.ky10.noarch is already installed.
Package perl-YAML-help-1.26-5.ky10.noarch is already installed.
Package perl-autodie-2.29-398.ky10.noarch is already installed.
Package perl-autodie-help-2.29-398.ky10.noarch is already installed.
Package perl-bignum-0.50-4.ky10.noarch is already installed.
Package perl-bignum-help-0.50-4.ky10.noarch is already installed.
Package perl-common-sense-help-3.7.4-14.ky10.noarch is already installed.
Package perl-constant-1.33-421.ky10.noarch is already installed.
Package perl-constant-help-1.33-421.ky10.noarch is already installed.
Package perl-devel-4:5.28.0-434.ky10.mips64el is already installed.
Package perl-experimental-0.020-2.ky10.noarch is already installed.
Package perl-experimental-help-0.020-2.ky10.noarch is already installed.
Package perl-gettext-help-1.07-13.ky10.noarch is already installed.
Package perl-inc-latest-help-2:0.500-12.ky10.noarch is already installed.
Package perl-libintl-perl-help-1.29-6.ky10.noarch is already installed.
Package perl-libnet-3.11-420.ky10.noarch is already installed.
Package perl-libnet-help-3.11-420.ky10.noarch is already installed.
Package perl-libs-4:5.28.0-434.ky10.mips64el is already installed.
Package perl-libwww-perl-help-6.35-2.ky10.noarch is already installed.
Package perl-libxml-perl-help-0.08-36.ky10.noarch is already installed.
Package perl-parent-1:0.237-4.ky10.noarch is already installed.
Package perl-parent-help-1:0.237-4.ky10.noarch is already installed.
Package perl-perlfaq-5.20180915-5.ky10.noarch is already installed.
Package perl-perlfaq-help-5.20180915-5.ky10.noarch is already installed.
Package perl-podlators-1:4.11-5.ky10.noarch is already installed.
Package perl-podlators-help-1:4.11-5.ky10.noarch is already installed.
Package perl-strictures-help-2.000006-7.ky10.noarch is already installed.
Package perl-threads-1:2.22-419.ky10.mips64el is already installed.
Package perl-threads-help-1:2.22-419.ky10.noarch is already installed.
Package perl-threads-shared-1.59-2.ky10.mips64el is already installed.
Package perl-threads-shared-help-1.59-2.ky10.noarch is already installed.
Package perl-version-8:0.99.24-3.ky10.mips64el is already installed.
Package perl-version-help-8:0.99.24-3.ky10.noarch is already installed.
Package make-1:4.2.1-15.ky10.mips64el is already installed.

创建mysql用户与用户组

[root@localhost /]# groupadd mysql
groupadd:“mysql”组已存在
[root@localhost /]# id mysql
用户id=27(mysql) 组id=27(mysql) 组=27(mysql)

创建并修改/mysqlsoft/mysql与/mysqldata/mysql目录权限

[root@localhost /]# mkdir -p /mysqlsoft/mysql
[root@localhost /]# mkdir -p /mysqldata/mysql
[root@localhost /]# chown -R mysql:mysql /mysqlsoft
[root@localhost /]# chown -R mysql:mysql /mysqldata
[root@localhost /]# chmod -R 775 /mysqlsoft
[root@localhost /]# chmod -R 775 /mysqldata

解压MySQL源码包

[root@localhost soft]# tar -zxvf  mysql-boost-5.7.39.tar.gz
[root@localhost soft]# ls -lrt
总用量 3643996
drwxr-xr-x 34 7161 31415       4096  6月  8 16:48 mysql-5.7.39
-rw-------  1 root root    53243335 11月 15 22:24 mysql-boost-5.7.39.tar.gz

编译安装

[root@localhost mysql-5.7.39]# cmake . -DCMAKE_INSTALL_PREFIX=/mysqlsoft/mysql  -DMYSQL_DATADIR=/mysqldata/mysql  -DSYSCONFDIR=/mysqlsoft/mysql/mysql.sock  -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/soft/mysql-5.7.39/boost/boost_1_59_0 -DWITH_INNOBASE_STORAGE_ENGINE=1  -DWITH_PARTITION_STORAGE_ENGINE=1  -DWITH_FEDERATED_STORAGE_ENGINE=1  -DWITH_BLACKHOLE_STORAGE_ENGINE=1  -DWITH_MYISAM_STORAGE_ENGINE=1  -DENABLED_LOCAL_INFILE=1  -DENABLE_DTRACE=0  -DDEFAULT_CHARSET=utf8mb4  -DDEFAULT_COLLATION=utf8mb4_general_ci  -DWITH_EMBEDDED_SERVER=1
CMake Deprecation Warning at CMakeLists.txt:35 (CMAKE_POLICY):
  The OLD behavior for policy CMP0018 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:41 (CMAKE_POLICY):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:48 (CMAKE_POLICY):
  The OLD behavior for policy CMP0045 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:49 (CMAKE_POLICY):
  The OLD behavior for policy CMP0042 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Running cmake version 3.12.1
-- Found Git: /usr/bin/git (found version "2.27.0")
-- Configuring with MAX_INDEXES = 64U
CMake Warning (dev) at CMakeLists.txt:146 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

-- CMAKE_GENERATOR: Unix Makefiles
-- SIZEOF_VOIDP 8
-- MySQL 5.7.39
-- Packaging as: mysql-5.7.39-Linux-mips64el
-- DTRACE is disabled
-- Local boost dir /soft/mysql-5.7.39/boost/boost_1_59_0
-- Found /soft/mysql-5.7.39/boost/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR /soft/mysql-5.7.39/boost/boost_1_59_0
-- NUMA library missing or required version not available
-- ZLIB_VERSION (bundled) is 1.2.12
-- ZLIB_INCLUDE_DIR /soft/mysql-5.7.39/extra/zlib/zlib-1.2.12
-- ZLIB_LIBRARY zlib
-- OPENSSL_INCLUDE_DIR = /usr/include
-- OPENSSL_LIBRARY = /usr/lib64/libssl.so
-- CRYPTO_LIBRARY = /usr/lib64/libcrypto.so
-- OPENSSL_MAJOR_VERSION = 1
-- OPENSSL_MINOR_VERSION = 01
-- OPENSSL_FIX_VERSION = 01
-- SSL_LIBRARIES = /usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl
-- AWK_EXECUTABLE is /usr/bin/gawk
-- Found Git: /usr/bin/git
-- LIBEVENT_VERSION_STRING 2.1.11-stable
-- LIBEVENT_VERSION (bundled) 2.1.11
-- WITH_PROTOBUF=bundled
-- protobuf version is 2.6
-- You need to set WITH_CURL. This variable needs to point to curl library.
-- Creating LDAP authentication SASL client library.
-- Required SASL header is missing.Skipping the LDAP SASL client authentication plugin.
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlclient
-- MERGE_CONVENIENCE_LIBRARIES LIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS clientlib;dbug;strings;vio;mysys;mysys_ssl;zlib
-- RPC_INCLUDE_DIRS /usr/include/tirpc
-- Using Boost headers from /soft/mysql-5.7.39/boost/boost_1_59_0
-- Performing Test CXX_HAVE_SIGN_COMPARE
-- Performing Test CXX_HAVE_SIGN_COMPARE - Success
-- Performing Test CXX_HAVE_UNUSED_VARIABLE
-- Performing Test CXX_HAVE_UNUSED_VARIABLE - Success
-- MYSQLX - Text log of protobuf messages enabled
-- Performing Test HAVE_UNUSED_PARAMETER
-- Performing Test HAVE_UNUSED_PARAMETER - Success
-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80
-- Performing Test HAVE_MISLEADING_INDENTATION
-- Performing Test HAVE_MISLEADING_INDENTATION - Success
-- Performing Test HAVE_NO_BUILTIN_MEMCMP
-- Performing Test HAVE_NO_BUILTIN_MEMCMP - Success
-- executable target mysqld debug_target /soft/debug/sql/mysqld
CMake Warning at cmake/bison.cmake:27 (MESSAGE):
  Bison executable not found in PATH
Call Stack (most recent call first):
  sql/CMakeLists.txt:603 (INCLUDE)


CMake Warning at cmake/bison.cmake:27 (MESSAGE):
  Bison executable not found in PATH
Call Stack (most recent call first):
  libmysqld/CMakeLists.txt:215 (INCLUDE)


-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl;crypt
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlserver
-- MERGE_CONVENIENCE_LIBRARIES LIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl;crypt;archive_embedded;blackhole_embedded;csv_embedded;federated_embedded;heap_embedded;innobase_embedded;lz4_lib;myisam_embedded;myisammrg_embedded;partition_embedded;ngram_parser_embedded;sql_embedded
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS dbug;strings;regex;mysys;mysys_ssl;vio;zlib;archive_embedded;blackhole_embedded;csv_embedded;federated_embedded;heap_embedded;innobase_embedded;lz4_lib;myisam_embedded;myisammrg_embedded;partition_embedded;ngram_parser_embedded;sql_embedded
-- library target mysqlserver debug_target /soft/debug/archive_output_directory/libmysqld.a
-- INSTALL mysqlclient.pc lib/pkgconfig
-- Skipping deb packaging on unsupported platform .
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;HAVE_TLSv13
-- CMAKE_C_FLAGS: -fPIC -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -ffp-contract=off  -Wall -Wextra -Wformat-security -Wvla -Wimplicit-fallthrough=2 -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS: -fPIC -std=gnu++03 -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -ffp-contract=off  -Wall -Wextra -Wformat-security -Wvla -Wimplicit-fallthrough=2 -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_CXX_FLAGS_DEBUG: -DENABLED_DEBUG_SYNC -DSAFE_MUTEX
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -ffunction-sections -fdata-sections
-- CMAKE_CXX_FLAGS_RELEASE: -ffunction-sections -fdata-sections
-- CMAKE_CXX_FLAGS_MINSIZEREL: -ffunction-sections -fdata-sections
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_EXE_LINKER_FLAGS
-- CMAKE_MODULE_LINKER_FLAGS
-- CMAKE_SHARED_LINKER_FLAGS
-- Configuring done
-- Generating done
-- Build files have been written to: /soft/mysql-5.7.39




[root@localhost mysql-5.7.39]# make -j 4


[root@localhost mysql-5.7.39]# make install

-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/memory_tb3.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/myisam_tb3.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/ndb_tb3.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/t3.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/myisam_tb2.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/myisam_tb4.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/memory_tb4.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/funcs_1/memory_tb2.txt
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/server8k-cert.pem
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/latin1.xml
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/bug16266.000001
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/replicated-bin.index
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/.mylogin.cnf
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/slave-relay-bin.000001
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/wl6219_55_innodb.frm
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/data_50722.zip
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/bug46565.ARZ
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/server-key-verify-pass.pem
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/server-key.pem
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/bug46565.frm
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/bug37631.MYI
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/server-cert-verify-fail.pem
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/bug21542698.dat
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/loaddata7.dat
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/expired-ca.pem
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/binlog_truncated_event.000001
-- Installing: /mysqlsoft/mysql/mysql-test/./std_data/loaddata_pair.dat
-- Installing: /mysqlsoft/mysql/./README-test
-- Up-to-date: /mysqlsoft/mysql/mysql-test/mtr
-- Up-to-date: /mysqlsoft/mysql/mysql-test/mysql-test-run
-- Installing: /mysqlsoft/mysql/mysql-test/lib/My/SafeProcess/my_safe_process
-- Up-to-date: /mysqlsoft/mysql/mysql-test/lib/My/SafeProcess/my_safe_process
-- Installing: /mysqlsoft/mysql/mysql-test/lib/My/SafeProcess/Base.pm
-- Installing: /mysqlsoft/mysql/support-files/mysqld_multi.server
-- Installing: /mysqlsoft/mysql/support-files/mysql-log-rotate
-- Installing: /mysqlsoft/mysql/support-files/magic
-- Installing: /mysqlsoft/mysql/share/aclocal/mysql.m4
-- Installing: /mysqlsoft/mysql/support-files/mysql.server

配置mysql参数,只是设置几个简单的mysql运行参数

[mysql@localhost mysql]$ cat my.cnf
[mysqld]
basedir=/mysqlsoft/mysql
datadir=/mysqldata/mysql
bind-address=0.0.0.0
user=mysql
port=3306
log-error=/mysqldata/mysql/mysql.err
pid-file=/mysqldata/mysql/mysqld.pid
socket = /mysqlsoft/mysql/mysql.sock
character-set-server=utf8mb4
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true
########innodb settings########
innodb_page_size = 8192
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 2
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_lru_scan_depth = 2000
innodb_lock_wait_timeout = 5
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_flush_method = O_DIRECT
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_log_group_home_dir =/msyqldata/redolog/
innodb_undo_directory =/mysqldata/undolog/
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_flush_nei***ors = 1
innodb_log_file_size = 1G
innodb_log_buffer_size = 16777216
innodb_purge_threads = 4
innodb_large_prefix = 1
innodb_thread_concurrency = 64
innodb_print_all_deadlocks = 1
innodb_strict_mode = 1
innodb_sort_buffer_size = 67108864

[root@localhost bin]# ./mysqld  --defaults-file=/mysqlsoft/mysql/my.cnf --initialize --basedir=/mysqlsoft/mysql --datadir=/mysqldata/mysql --user=mysql

[mysql@localhost mysql]$ tail -f mysql.err
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
2022-11-18T13:26:36.602330Z 0 [Warning] InnoDB: New log files created, LSN=39537
2022-11-18T13:26:36.741745Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-11-18T13:26:36.806980Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a0976fe4-6744-11ed-8ede-0023a0002161.
2022-11-18T13:26:36.809665Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-11-18T13:26:37.348420Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-11-18T13:26:37.348462Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-11-18T13:26:37.350930Z 0 [Warning] CA certificate ca.pem is self signed.
2022-11-18T13:26:37.589677Z 1 [Note] A temporary password is generated for root@localhost: KuOS*vY&V1Dx


其中[Note] A temporary password is generated for root@localhost:后面跟的是mysql数据库登录的临时密码,各人安装生成的临时密码不一样。可以看到到日志文件没有报错,而且有了临时密码,表示初始化成功。

如果想服务能够部署自动支持安全连接,使用mysql_ssl_rsa_setup工具来创建缺省SSL与RSA文件

[root@localhost bin]#  ./mysql_ssl_rsa_setup --datadir=/mysqldata/mysql

配置环境变量

[root@localhost /]# vi /etc/profile
export MYSQL_HOME=/mysqlsoft/mysql/
export PATH=$PATH:$MYSQL_HOME/bin

[root@localhost /]# vi /etc/profile
[root@localhost /]# source /etc/profile

配置自动启动MySQL

[root@localhost /]# cp /mysqlsoft/mysql/support-files/mysql.server  /etc/init.d/mysqld
[root@localhost /]# chmod 755 /etc/init.d/mysqld
[root@localhost ~]# systemctl enable mysqld
mysqld.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysqld on

启动MySQL

[root@localhost /]# service mysqld start
Starting MySQL... SUCCESS!

登录MySQL并修改root用户密码

[root@localhost tmp]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.39

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

benchmarksql 5.0压测MySQL

在Oracle Linux 7.6使用benchmarksql 5.0压测MySQL 5.7

一.下载&编译安装

1.先要确定服务器是否安装了 JDK1.8

[root@localhost /]# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.2.0.1.el7_0-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

因为自带jdk存储在/usr/lib/jvm下,需要将其删除。

[root@localhost lib]# mv jvm jvmold
[root@localhost lib]# java -version
-bash: /usr/bin/java: ???

2.安装JDK1.8

[root@localhost /]# tar -zxvf jdk-linux-x64.tar.gz

[root@localhost /]# mkdir /usr/java
[root@localhost /]# mv jdk1.8.0_131 /usr/java/
[root@localhost /]# vi /etc/profile
....
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}

[root@localhost /]# source /etc/profile
[root@localhost /]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

[root@localhost /]# unzip benchmarksql-5.0.zip
[root@localhost /]# cd benchmarksql-5.0/

修改benchmarksql源码

修改jTPCCConfig.java文件

[root@localhost benchmarksql-5.0]# vi src/client/jTPCCConfig.java
/*
* jTPCCConfig - Basic configuration parameters for jTPCC
*
* Copyright (C) 2003, Raul Barbosa
* Copyright (C) 2004-2016, Denis Lussier
* Copyright (C) 2016, Jan Wieck
*
*/

import java.text.*;

public interface jTPCCConfig
{
public final static String JTPCCVERSION = "5.0";

public final static int DB_UNKNOWN = 0,
DB_FIREBIRD = 1,
DB_ORACLE = 2,
DB_POSTGRES = 3,
DB_MYSQL =4;

public final static int NEW_ORDER = 1,
PAYMENT = 2,
ORDER_STATUS = 3,
DELIVERY = 4,
STOCK_LEVEL = 5;

public final static String[] nameTokens = {"BAR", "OUGHT", "ABLE", "PRI", "PRES", "ESE", "ANTI", "CALLY", "ATION", "EING"};

public final static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

public final static int configCommitCount = 10000; // commit every n records in LoadData

public final static int configWhseCount = 10;
public final static int configItemCount = 100000; // tpc-c std = 100,000
public final static int configDistPerWhse = 10; // tpc-c std = 10
public final static int configCustPerDist = 3000; // tpc-c std = 3,000
}

修改benchmarksql-5.0/src/client/jTPCC.java,增加mysql相关部分

[root@localhost benchmarksql-5.0]# vi src/client/jTPCC.java
/*
* jTPCC - Open Source Java implementation of a TPC-C like benchmark
*
* Copyright (C) 2003, Raul Barbosa
* Copyright (C) 2004-2016, Denis Lussier
* Copyright (C) 2016, Jan Wieck
*
*/

import org.apache.log4j.*;

import java.io.*;
import java.nio.file.*;
import java.sql.*;
import java.util.*;
import java.util.regex.Pattern;
import java.text.*;

public class jTPCC implements jTPCCConfig
{
private static org.apache.log4j.Logger log = Logger.getLogger(jTPCC.class);
private static String resultDirName = null;
private static BufferedWriter resultCSV = null;
private static BufferedWriter runInfoCSV = null;
private static int runID = 0;

private int dbType = DB_UNKNOWN;
private int currentlyDisplayedTerminal;

private jTPCCTerminal[] terminals;
private String[] terminalNames;
private boolean terminalsBlockingExit = false;
private long terminalsStarted = 0, sessionCount = 0, transactionCount = 0;
private Object counterLock = new Object();

private long newOrderCounter = 0, sessionStartTimestamp, sessionEndTimestamp, sessionNextTimestamp=0, sessionNextKounter=0;
private long sessionEndTargetTime = -1, fastNewOrderCounter, recentTpmC=0, recentTpmTotal=0;
private boolean signalTerminalsRequestEndSent = false, databaseDriverLoaded = false;

private FileOutputStream fileOutputStream;
private PrintStream printStreamReport;
private String sessionStart, sessionEnd;
private int limPerMin_Terminal;

private double tpmC;
private jTPCCRandom rnd;
private OSCollector osCollector = null;

public static void main(String args[])
{
PropertyConfigurator.configure("log4j.properties");
new jTPCC();
}

private String getProp (Properties p, String pName)
{
String prop = p.getProperty(pName);
log.info("Term-00, " + pName + "=" + prop);
return(prop);
}

public jTPCC()
{

// load the ini file
Properties ini = new Properties();
try {
ini.load( new FileInputStream(System.getProperty("prop")));
} catch (IOException e) {
errorMessage("Term-00, could not load properties file");
}

log.info("Term-00, ");
log.info("Term-00, +-------------------------------------------------------------+");
log.info("Term-00, BenchmarkSQL v" + JTPCCVERSION);
log.info("Term-00, +-------------------------------------------------------------+");
log.info("Term-00, (c) 2003, Raul Barbosa");
log.info("Term-00, (c) 2004-2016, Denis Lussier");
log.info("Term-00, (c) 2016, Jan Wieck");
log.info("Term-00, +-------------------------------------------------------------+");
log.info("Term-00, ");
String iDB = getProp(ini,"db");
String iDriver = getProp(ini,"driver");
String iConn = getProp(ini,"conn");
String iUser = getProp(ini,"user");
String iPassword = ini.getProperty("password");

log.info("Term-00, ");
String iWarehouses = getProp(ini,"warehouses");
String iTerminals = getProp(ini,"terminals");

String iRunTxnsPerTerminal = ini.getProperty("runTxnsPerTerminal");
String iRunMins = ini.getProperty("runMins");
if (Integer.parseInt(iRunTxnsPerTerminal) ==0 && Integer.parseInt(iRunMins)!=0){
log.info("Term-00, runMins" + "=" + iRunMins);
}else if(Integer.parseInt(iRunTxnsPerTerminal) !=0 && Integer.parseInt(iRunMins)==0){
log.info("Term-00, runTxnsPerTerminal" + "=" + iRunTxnsPerTerminal);
}else{
errorMessage("Term-00, Must indicate either transactions per terminal or number of run minutes!");
};
String limPerMin = getProp(ini,"limitTxnsPerMin");
String iTermWhseFixed = getProp(ini,"terminalWarehouseFixed");
log.info("Term-00, ");
String iNewOrderWeight = getProp(ini,"newOrderWeight");
String iPaymentWeight = getProp(ini,"paymentWeight");
String iOrderStatusWeight = getProp(ini,"orderStatusWeight");
String iDeliveryWeight = getProp(ini,"deliveryWeight");
String iStockLevelWeight = getProp(ini,"stockLevelWeight");

log.info("Term-00, ");
String resultDirectory = getProp(ini, "resultDirectory");
String osCollectorScript = getProp(ini, "osCollectorScript");

log.info("Term-00, ");

if (iDB.equals("firebird"))
dbType = DB_FIREBIRD;
else if (iDB.equals("oracle"))
dbType = DB_ORACLE;
else if (iDB.equals("postgres"))
dbType = DB_POSTGRES;
else if (iDB.equals("mysql"))
dbType = DB_MYSQL;
else
{
log.error("unknown database type '" + iDB + "'");
return;

修改benchmarksql-5.0/src/client/jTPCCConnection.java, SQL子查询增加”AS L”别名,如下所示:

[root@localhost benchmarksql-5.0]# vi src/client/jTPCCConnection.java
switch (dbType)
{
case jTPCCConfig.DB_POSTGRES:
stmtStockLevelSelectLow = dbConn.prepareStatement(
"SELECT count(*) AS low_stock FROM (" +
" SELECT s_w_id, s_i_id, s_quantity " +
" FROM bmsql_stock " +
" WHERE s_w_id = ? AND s_quantity < ? AND s_i_id IN (" +
" SELECT ol_i_id " +
" FROM bmsql_district " +
" JOIN bmsql_order_line ON ol_w_id = d_w_id " +
" AND ol_d_id = d_id " +
" AND ol_o_id >= d_next_o_id - 20 " +
" AND ol_o_id < d_next_o_id " +
" WHERE d_w_id = ? AND d_id = ? " +
" ) " +
" ) AS L");
break;

default:
stmtStockLevelSelectLow = dbConn.prepareStatement(
"SELECT count(*) AS low_stock FROM (" +
" SELECT s_w_id, s_i_id, s_quantity " +
" FROM bmsql_stock " +
" WHERE s_w_id = ? AND s_quantity < ? AND s_i_id IN (" +
" SELECT ol_i_id " +
" FROM bmsql_district " +
" JOIN bmsql_order_line ON ol_w_id = d_w_id " +
" AND ol_d_id = d_id " +
" AND ol_o_id >= d_next_o_id - 20 " +
" AND ol_o_id < d_next_o_id " +
" WHERE d_w_id = ? AND d_id = ? " +
" ) " +
" )AS L"); // " )");
break;
}

[root@localhost benchmarksql-5.0]# ant
Buildfile: /benchmarksql-5.0/build.xml

init:
[mkdir] Created dir: /benchmarksql-5.0/build

compile:
[javac] Compiling 11 source files to /benchmarksql-5.0/build
[javac] /benchmarksql-5.0/src/client/jTPCCRandom.java:143: : EUC_CN [javac] * be able to represent 128 different characters. '#@!%%???'
[javac] ^
[javac] /benchmarksql-5.0/src/client/jTPCCRandom.java:143: : EUC_CN [javac] * be able to represent 128 different characters. '#@!%%???'
[javac] ^
[javac] /benchmarksql-5.0/src/client/jTPCCRandom.java:143: : EUC_CN [javac] * be able to represent 128 different characters. '#@!%%???'
[javac] ^
[javac] 3

BUILD FAILED
/benchmarksql-5.0/build.xml:24: Compile failed; see the compiler error output for details.

Total time: 1 second

修改字符集

[root@localhost benchmarksql-5.0]# cat /etc/oracle-release
Oracle Linux Server release 7.6
[root@localhost benchmarksql-5.0]# locale
LANG=zh_CN.gb2312
LC_CTYPE="zh_CN.gb2312"
LC_NUMERIC="zh_CN.gb2312"
LC_TIME="zh_CN.gb2312"
LC_COLLATE="zh_CN.gb2312"
LC_MONETARY="zh_CN.gb2312"
LC_MESSAGES="zh_CN.gb2312"
LC_PAPER="zh_CN.gb2312"
LC_NAME="zh_CN.gb2312"
LC_ADDRESS="zh_CN.gb2312"
LC_TELEPHONE="zh_CN.gb2312"
LC_MEASUREMENT="zh_CN.gb2312"
LC_IDENTIFICATION="zh_CN.gb2312"
LC_ALL=
[root@localhost benchmarksql-5.0]# cat /etc/sysconfig/i18n
cat: /etc/sysconfig/i18n: ???
[root@localhost benchmarksql-5.0]# cat cat /etc/locale.conf
cat: cat: ???
#LANG="en_US.UTF-8"
LANG="zh_CN.gb2312"
[root@localhost benchmarksql-5.0]# cat /etc/locale.conf
#LANG="en_US.UTF-8"
LANG="zh_CN.gb2312"
[root@localhost benchmarksql-5.0]# vi /etc/locale.conf
LANG="en_US.UTF-8"
#LANG="zh_CN.gb2312"

[root@localhost benchmarksql-5.0]# ant
Buildfile: /benchmarksql-5.0/build.xml

init:

compile:
[javac] Compiling 11 source files to /benchmarksql-5.0/build

dist:
[mkdir] Created dir: /benchmarksql-5.0/dist
[jar] Building jar: /benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar

BUILD SUCCESSFUL
Total time: 2 seconds

添加mysql java connector驱动,mysql-connector-java-5.1.49.zip 需自行下载。

[root@localhost benchmarksql-5.0]# cd lib
[root@localhost lib]# ls
apache-log4j-extras-1.1.jar firebird log4j-1.2.17.jar oracle postgres
[root@localhost lib]# ls -lrt
total 820
drwxr-xr-x. 2 root root 43 May 26 2016 postgres
drwxr-xr-x. 2 root root 40 May 26 2016 oracle
-rwxr-xr-x. 1 root root 489883 May 26 2016 log4j-1.2.17.jar
drwxr-xr-x. 2 root root 58 May 26 2016 firebird
-rwxr-xr-x. 1 root root 346729 May 26 2016 apache-log4j-extras-1.1.jar
[root@localhost lib]# mkdir mysql

[root@localhost /]# unzip mysql-connector-java-5.1.49.zip

[root@localhost mysql-connector-java-5.1.49]# cp mysql-connector-java-5.1.49.jar /benchmarksql-5.0/lib/mysql/

[root@localhost mysql]# pwd
/benchmarksql-5.0/lib/mysql
[root@localhost mysql]# ls -lrt
total 984
-rw-r--r--. 1 root root 1006904 Nov 11 16:39 mysql-connector-java-5.1.49.jar

修改benchmarksql-5.0/run/runDatabaseBuild.sh,去掉extraHistID

[root@localhost benchmarksql-5.0]# vi run/runDatabaseBuild.sh
#!/bin/sh

if [ $# -lt 1 ] ; then
echo "usage: $(basename $0) PROPS [OPT VAL [...]]" >&2
exit 2
fi

PROPS="$1"
shift
if [ ! -f "${PROPS}" ] ; then
echo "${PROPS}: no such file or directory" >&2
exit 1
fi
DB="$(grep '^db=' $PROPS | sed -e 's/^db=//')"

BEFORE_LOAD="tableCreates"
#AFTER_LOAD="indexCreates foreignKeys extraHistID buildFinish"
AFTER_LOAD="indexCreates foreignKeys buildFinish"

for step in ${BEFORE_LOAD} ; do
./runSQL.sh "${PROPS}" $step
done

./runLoader.sh "${PROPS}" $*

for step in ${AFTER_LOAD} ; do
./runSQL.sh "${PROPS}" $step
done

修改funcs.sh 增加 mysql 数据库类型的驱动类文件目录。

[root@localhost benchmarksql-5.0]# vi run/funcs.sh
# ----
# $1 is the properties file
# ----
PROPS=$1
if [ ! -f ${PROPS} ] ; then
echo "${PROPS}: no such file" >&2
exit 1
fi

# ----
# getProp()
#
# Get a config value from the properties file.
# ----
function getProp()
{
grep "^${1}=" ${PROPS} | sed -e "s/^${1}=//"
}

# ----
# getCP()
#
# Determine the CLASSPATH based on the database system.
# ----
function setCP()
{
case "$(getProp db)" in
firebird)
cp="../lib/firebird/*:../lib/*"
;;
oracle)
cp="../lib/oracle/*"
if [ ! -z "${ORACLE_HOME}" -a -d ${ORACLE_HOME}/lib ] ; then
cp="${cp}:${ORACLE_HOME}/lib/*"
fi
cp="${cp}:../lib/*"
;;
postgres)
cp="../lib/postgres/*:../lib/*"
;;
mysql)
cp="../lib/mysql/*:../lib/*"
;;
esac
myCP=".:${cp}:../dist/*"
export myCP
}

# ----
# Make sure that the properties file does have db= and the value
# is a database, we support.
# ----
case "$(getProp db)" in
firebird|oracle|postgres|mysql)
;;
"") echo "ERROR: missing db= config option in ${PROPS}" >&2
exit 1
;;
*) echo "ERROR: unsupported database type 'db=$(getProp db)' in ${PROPS}" >&2
exit 1
;;
esac
"run/funcs.sh" 63L, 1177C written

配置测试文件,输入连接地址与用户名

[root@localhost run]# vi props.mysql
db=mysql
driver=com.mysql.jdbc.Driver
conn=jdbc:mysql://127.0.0.1:3306/test?useServerPrepStmts=true&useConfigs=maxPerformance&rewriteBatchedStatements=true
user=root
password=xxzx7817600
warehouses=100
loadWorkers=40
terminals=32
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0
//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true
//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4
// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=user@dbhost
//osCollectorDevices=net_eth0 blk_sda

[mysql@localhost run]$ ./runDatabaseBuild.sh prop.mysql
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
Fri Nov 11 16:57:18 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Unknown database 'benchmarksql'
Starting BenchmarkSQL LoadData

driver=com.mysql.jdbc.Driver
conn=jdbc:mysql://127.0.0.1:3306/test?useServerPrepStmts=true&useConfigs=maxPerformance&rewriteBatchedStatements=true
user=root
password=***********
warehouses=100
loadWorkers=40
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')

Fri Nov 11 16:57:19 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
ERROR: Unknown database 'benchmarksql'
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
Fri Nov 11 16:57:20 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Unknown database 'benchmarksql'
# ------------------------------------------------------------
# Loading SQL file ./sql.common/foreignKeys.sql
# ------------------------------------------------------------
Fri Nov 11 16:57:22 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Unknown database 'benchmarksql'
# ------------------------------------------------------------
# Loading SQL file ./sql.common/buildFinish.sql
# ------------------------------------------------------------
Fri Nov 11 16:57:23 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Unknown database 'benchmarksql'

不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5。45+, 5.6.26+和5.7。6+要求如果未设置显式选项,默认情况下必须建立SSL连接。为了符合不使用SSL的现有应用程序,verifyServerCertificate属性设置为“false”。您需要通过设置useSSL=false显式禁用SSL,或者设置useSSL=true并为服务器证书验证提供信任库。

解决方案:
在url后面加上?useSSL=false即可

jdbc:mysql://localhost:3306/userDb?useSSL=false
----------------
[mysql@localhost run]$ vi prop.mysql
db=mysql
driver=com.mysql.jdbc.Driver
conn=jdbc:mysql://127.0.0.1:3306/test?useSSL=false&useServerPrepStmts=true&useConfigs=maxPerformance&rewriteBatchedStatements=true
user=root
password=xxzx7817600
warehouses=100
loadWorkers=40
terminals=32
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0
//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true
//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4
// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=user@dbhost
//osCollectorDevices=net_eth0 blk_sda

[mysql@localhost run]$ ./runDatabaseBuild.sh props.mysql
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
create table bmsql_config (
cfg_name varchar(30) primary key,
cfg_value varchar(50)
);
create table bmsql_warehouse (
w_id integer not null,
w_ytd decimal(12,2),
w_tax decimal(4,4),
w_name varchar(10),
w_street_1 varchar(20),
w_street_2 varchar(20),
w_city varchar(20),
w_state char(2),
w_zip char(9)
);
create table bmsql_district (
d_w_id integer not null,
d_id integer not null,
d_ytd decimal(12,2),
d_tax decimal(4,4),
d_next_o_id integer,
d_name varchar(10),
d_street_1 varchar(20),
d_street_2 varchar(20),
d_city varchar(20),
d_state char(2),
d_zip char(9)
);
create table bmsql_customer (
c_w_id integer not null,
c_d_id integer not null,
c_id integer not null,
c_discount decimal(4,4),
c_credit char(2),
c_last varchar(16),
c_first varchar(16),
c_credit_lim decimal(12,2),
c_balance decimal(12,2),
c_ytd_payment decimal(12,2),
c_payment_cnt integer,
c_delivery_cnt integer,
c_street_1 varchar(20),
c_street_2 varchar(20),
c_city varchar(20),
c_state char(2),
c_zip char(9),
c_phone char(16),
c_since timestamp,
c_middle char(2),
c_data varchar(500)
);
create sequence bmsql_hist_id_seq;
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sequence bmsql_hist_id_seq' at line 1
create table bmsql_history (
hist_id integer,
h_c_id integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id integer,
h_w_id integer,
h_date timestamp,
h_amount decimal(6,2),
h_data varchar(24)
);
create table bmsql_new_order (
no_w_id integer not null,
no_d_id integer not null,
no_o_id integer not null
);
create table bmsql_oorder (
o_w_id integer not null,
o_d_id integer not null,
o_id integer not null,
o_c_id integer,
o_carrier_id integer,
o_ol_cnt integer,
o_all_local integer,
o_entry_d timestamp
);
create table bmsql_order_line (
ol_w_id integer not null,
ol_d_id integer not null,
ol_o_id integer not null,
ol_number integer not null,
ol_i_id integer not null,
ol_delivery_d timestamp,
ol_amount decimal(6,2),
ol_supply_w_id integer,
ol_quantity integer,
ol_dist_info char(24)
);
create table bmsql_item (
i_id integer not null,
i_name varchar(24),
i_price decimal(5,2),
i_data varchar(50),
i_im_id integer
);
create table bmsql_stock (
s_w_id integer not null,
s_i_id integer not null,
s_quantity integer,
s_ytd integer,
s_order_cnt integer,
s_remote_cnt integer,
s_data varchar(50),
s_dist_01 char(24),
s_dist_02 char(24),
s_dist_03 char(24),
s_dist_04 char(24),
s_dist_05 char(24),
s_dist_06 char(24),
s_dist_07 char(24),
s_dist_08 char(24),
s_dist_09 char(24),
s_dist_10 char(24)
);
Starting BenchmarkSQL LoadData

driver=com.mysql.jdbc.Driver
conn=jdbc:mysql://127.0.0.1:3306/test?useSSL=false&useServerPrepStmts=true&useConfigs=maxPerformance&rewriteBatchedStatements=true
user=root
password=***********
warehouses=100
loadWorkers=40
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')

Worker 000: Loading ITEM
Worker 001: Loading Warehouse 1
Worker 002: Loading Warehouse 2
Worker 003: Loading Warehouse 3
Worker 004: Loading Warehouse 4
Worker 005: Loading Warehouse 5
Worker 006: Loading Warehouse 6
Worker 007: Loading Warehouse 7
Worker 008: Loading Warehouse 8
Worker 010: Loading Warehouse 10
Worker 009: Loading Warehouse 9
Worker 011: Loading Warehouse 11
Worker 012: Loading Warehouse 12
Worker 013: Loading Warehouse 13
Worker 014: Loading Warehouse 14
Worker 015: Loading Warehouse 15
Worker 016: Loading Warehouse 16
Worker 017: Loading Warehouse 17
Worker 018: Loading Warehouse 18
Worker 019: Loading Warehouse 19
Worker 020: Loading Warehouse 20
Worker 021: Loading Warehouse 21
Worker 022: Loading Warehouse 22
Worker 023: Loading Warehouse 23
Worker 024: Loading Warehouse 24
Worker 025: Loading Warehouse 25
Worker 026: Loading Warehouse 26
Worker 027: Loading Warehouse 27
Worker 028: Loading Warehouse 28
Worker 029: Loading Warehouse 29
Worker 030: Loading Warehouse 30
Worker 032: Loading Warehouse 31
Worker 031: Loading Warehouse 32
Worker 033: Loading Warehouse 33
Worker 034: Loading Warehouse 34
Worker 035: Loading Warehouse 35
Worker 036: Loading Warehouse 36
Worker 037: Loading Warehouse 37
Worker 038: Loading Warehouse 38
Worker 039: Loading Warehouse 39
Worker 000: Loading ITEM done
Worker 000: Loading Warehouse 40
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
alter table bmsql_warehouse add constraint bmsql_warehouse_pkey
primary key (w_id);
alter table bmsql_district add constraint bmsql_district_pkey
primary key (d_w_id, d_id);
alter table bmsql_customer add constraint bmsql_customer_pkey
primary key (c_w_id, c_d_id, c_id);
create index bmsql_customer_idx1
on bmsql_customer (c_w_id, c_d_id, c_last, c_first);
alter table bmsql_oorder add constraint bmsql_oorder_pkey
primary key (o_w_id, o_d_id, o_id);
create unique index bmsql_oorder_idx1
on bmsql_oorder (o_w_id, o_d_id, o_carrier_id, o_id);
alter table bmsql_new_order add constraint bmsql_new_order_pkey
primary key (no_w_id, no_d_id, no_o_id);
alter table bmsql_order_line add constraint bmsql_order_line_pkey
primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);
alter table bmsql_stock add constraint bmsql_stock_pkey
primary key (s_w_id, s_i_id);
alter table bmsql_item add constraint bmsql_item_pkey
primary key (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/foreignKeys.sql
# ------------------------------------------------------------
alter table bmsql_district add constraint d_warehouse_fkey
foreign key (d_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_customer add constraint c_district_fkey
foreign key (c_w_id, c_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_history add constraint h_customer_fkey
foreign key (h_c_w_id, h_c_d_id, h_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_history add constraint h_district_fkey
foreign key (h_w_id, h_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_new_order add constraint no_order_fkey
foreign key (no_w_id, no_d_id, no_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_oorder add constraint o_customer_fkey
foreign key (o_w_id, o_d_id, o_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_order_line add constraint ol_order_fkey
foreign key (ol_w_id, ol_d_id, ol_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_order_line add constraint ol_stock_fkey
foreign key (ol_supply_w_id, ol_i_id)
references bmsql_stock (s_w_id, s_i_id);
alter table bmsql_stock add constraint s_warehouse_fkey
foreign key (s_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_stock add constraint s_item_fkey
foreign key (s_i_id)
references bmsql_item (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/buildFinish.sql
# ------------------------------------------------------------
-- ----
-- Extra commands to run after the tables are created, loaded,
-- indexes built and extra's created.
-- ----

[mysql@localhost run]$ ./runBenchmark.sh props.mysql
09:25:48,374 [main] INFO jTPCC : Term-00,
09:25:48,379 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
09:25:48,379 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
09:25:48,379 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
09:25:48,379 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
09:25:48,379 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
09:25:48,384 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
09:25:48,385 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
09:25:48,385 [main] INFO jTPCC : Term-00,
09:25:48,385 [main] INFO jTPCC : Term-00, db=mysql
09:25:48,385 [main] INFO jTPCC : Term-00, driver=com.mysql.jdbc.Driver
09:25:48,385 [main] INFO jTPCC : Term-00, conn=jdbc:mysql://127.0.0.1:3306/test?useSSL=false
09:25:48,385 [main] INFO jTPCC : Term-00, user=root
09:25:48,386 [main] INFO jTPCC : Term-00,
09:25:48,386 [main] INFO jTPCC : Term-00, warehouses=40
09:25:48,386 [main] INFO jTPCC : Term-00, terminals=10
09:25:48,388 [main] INFO jTPCC : Term-00, runMins=10
09:25:48,388 [main] INFO jTPCC : Term-00, limitTxnsPerMin=0
09:25:48,388 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
09:25:48,389 [main] INFO jTPCC : Term-00,
09:25:48,389 [main] INFO jTPCC : Term-00, newOrderWeight=45
09:25:48,389 [main] INFO jTPCC : Term-00, paymentWeight=43
09:25:48,389 [main] INFO jTPCC : Term-00, orderStatusWeight=4
09:25:48,389 [main] INFO jTPCC : Term-00, deliveryWeight=4
09:25:48,389 [main] INFO jTPCC : Term-00, stockLevelWeight=4
09:25:48,389 [main] INFO jTPCC : Term-00,
09:25:48,389 [main] INFO jTPCC : Term-00, resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
09:25:48,390 [main] INFO jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
09:25:48,390 [main] INFO jTPCC : Term-00,
09:25:48,529 [main] INFO jTPCC : Term-00, copied props.mysql to my_result_2022-11-14_092548/run.properties
09:25:48,529 [main] INFO jTPCC : Term-00, created my_result_2022-11-14_092548/data/runInfo.csv for runID 5
09:25:48,530 [main] INFO jTPCC : Term-00, writing per transaction results to my_result_2022-11-14_092548/data/result.csv
09:25:48,531 [main] INFO jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
09:25:48,532 [main] INFO jTPCC : Term-00, osCollectorInterval=1
09:25:48,532 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
09:25:48,532 [main] INFO jTPCC : Term-00, osCollectorDevices=null
09:25:48,684 [main] INFO jTPCC : Term-00,
09:25:49,097 [main] INFO jTPCC : Term-00, C value for C_LAST during load: 182
09:25:49,098 [main] INFO jTPCC : Term-00, C value for C_LAST this run: 253
09:25:49,098 [main] INFO jTPCC : Term-00,
Term-00, Running Average tpmTOTAL: 32447.84 Current tpmTOTAL: 2146668 Memory Usage: 143MB / 203MB
09:35:49,526 [Thread-6] INFO jTPCC : Term-00,
09:35:49,526 [Thread-6] INFO jTPCC : Term-00,
09:35:49,527 [Thread-6] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 14913.98
09:35:49,527 [Thread-6] INFO jTPCC : Term-00, Measured tpmTOTAL = 32102.08
09:35:49,527 [Thread-6] INFO jTPCC : Term-00, Session Start = 2022-11-14 09:25:49
09:35:49,528 [Thread-6] INFO jTPCC : Term-00, Session End = 2022-11-14 09:35:49
09:35:49,528 [Thread-6] INFO jTPCC : Term-00, Transaction Count = 321069