Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL5.7.26 source code compilation and installation

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Install dependent components

Yum-y install gcc gcc-c++ pcre pcre-devel openssl openssl-devel

Yum-y install zlib zlib-devel cmake ncurses ncurses-devel bison bison-devel

The following dependencies need to be installed in CentOS7, but not in CentOS6

Yum-y install perl perl-devel autoconf

two。 Download the decompressed source package (including boost)

Tar xzf mysql-boost-5.7.26.tar.gz

3. MySQL users need to be added for the first installation

Useradd-s / sbin/nologin-M mysql

4. Starting from MySQL 5.7.5, the Boost library is required. Compiling requires at least one gigabyte of memory and time.

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DMYSQL_DATADIR=/data/mysql/3306\

-DSYSCONFDIR=/etc\

-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\

-DWITH_ARCHIVE_STORAGE_ENGINE=1\

-DMYSQL_UNIX_ADDR=/tmp/mysql3306.sock\

-DMYSQL_TCP_PORT=3306\

-DENABLED_LOCAL_INFILE=1\

-DEXTRA_CHARSETS=all\

-DDEFAULT_CHARSET=utf8mb4\

-DDEFAULT_COLLATION=utf8mb4_general_ci\

-DMYSQL_USER=mysql\

-DWITH_BINLOG_PREALLOC=ON\

-DWITH_BOOST=boost\

-DWITH_DEBUG=1

Make & & make install

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0log.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0purge.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0row.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0sel.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0trunc.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0uins.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0umod.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0undo.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0upd.cc.o

[24%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/row/row0quiesce.cc.o

5. Create a simple / etc/my.cnf follow-up supplement

[client]

No-auto-rehash

Default-character-set=utf8mb4

# password = your_password

Port = 3306

Socket = / tmp/mysql3306.sock

[mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_general_ci basedir=/usr/local/mysql/ datadir=/data/mysql/3306/ socket=/tmp/mysql3306.sock server-id = 1102200 log-bin=mysql_binlog binlog_format=row log_slave_updates = 1 skip_name_resolve = ON innodb_file_per_table = ON lower_case_table_names=1 max_allowed_packet = 1m table_open_cache = 512 sort_buffer_size = 2m read_buffer_size = 2m read_rnd_buffer_size = 8m [mysqld_safe] log-error=/data/mysql/3306/mysqld.log pid-file=/data/mysql/3306/mysqld.pid [mysqldump] quick max_allowed_packet = 16m [mysqlhotcopy] interactive-timeout

6. Join the daemon

Cd / usr/local/mysql

Cp support-files/mysql.server / etc/init.d/mysqld

Chmod axix / etc/init.d/mysqld

Chkconfig-add mysqld

Chkconfig-list mysqld

Chkconfig mysqld on

7. Initialize the database.-initialize means a secure password is generated by default, and-initialize-insecure means no password is generated.

Mysqld-initialize-insecure-user=mysql-basedir=/usr/local/mysql-datadir=/data/mysql/3306/

2019-07-15T03:46:38.859798Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2019-07-15T03:46:39.250281Z 0 [Warning] InnoDB: New log files created, LSN=45790

2019-07-15T03:46:39.410341Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2019-07-15T03:46:39.483526Z 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: 26fabfb6-a6b3-11e9-8f70-fa163efdf571.

2019-07-15T03:46:39.485233Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2019-07-15T03:46:39.486976Z 1 [Warning] root@localhost is created with an empty password! Please consider switching off the-- initialize-insecure option.

8. Start the service

Service mysqld start

Starting MySQL.Logging to'/ data/mysql/3306/mysqld.log'.

SUCCESS!

9. You don't need a password to log in for the first time, you can enter.

Mysql-u root-p

Set password for root@localhost = password ('root'); # change password

10.gdb

Cat debug.file

Break main # break point

Run-defaults-file=/etc/my.cnf-user=mysql-gdb # debugging

Chown mysql.mysql debug.file

11. Start the debugging environment

Gdb-x / data/mysql/3306/debug.file / usr/local/mysql/bin/mysqld GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see:... Reading symbols from / usr/local/mysql/bin/mysqld...done. Breakpoint 1 at 0xea031c: file / usr/local/mysql-5.7.26/sql/main.cc, line 25. [Thread debugging using libthread_db enabled] Using host libthread_db library "/ lib64/libthread_db.so.1". Breakpoint 1, main (argc=4, argv=0x7fffffffe538) at / usr/local/mysql-5.7.26/sql/main.cc:25 25 return mysqld_main (argc, argv) Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 libgcc-4.8.5-28.el7_5.1.x86_64 libstdc++-4.8.5-28.el7_5.1.x86_64 nss-softokn-freebl-3.34.0-2.el7.x86_64 (gdb)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report