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

Centos7 compilation and installation of mariadb-10.1.22

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Mariadb-10.1.22 source code compilation and installation

Download the file https://mariadb.com/

1. Install the development environment

Yum groupinstall "Development Tools"

Installation requires packages:

Yum install-y ncurses-devel openssl-devel openssl

two。 Install cmake

Tar-xf cmake-3.8.0.tar.gzcd cmake-3.8.0./bootstrapmakemake install

3. Pre-installation preparation

3.1. Prepare the catalog

Mkdir-pv / data/mysql/3306/ {data,logs/ {binlog,relaylog}}

3.2. Add user

Groupadd mysqluseradd-s / sbin/nologin-g mysql-M mysqlchown mysql:mysql / data/mysql/3306/-R

4. Compilation and installation

# tar-xf mariadb-10.1.22.tar.gz # cd mariadb-10.1.22# cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_DATADIR=/data/mysql/3306/data\-DMYSQL_USER=mysql\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITH_READLINE=1\-DWITH_SSL=system\-DWITH_ZLIB=system\-DWITH_LIBWRAP=0\-DMYSQL_UNIX_ADDR=/tmp/mysql .sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DMYSQL_UNIX_ADDR=/tmp/mysql.sock\-DENABLED_LOCAL_INFILE=1\-DWITH_PARTITION_STORAGE_ENGINE=1\-DWITH_DEBUG=0\-DWITHOUT_MROONGA_STORAGE_ENGINE=1# make# make install

5. Prepare the environment after installation

# chmod + w / usr/local/mysql/# chown-R mysql:mysql / usr/local/mysql/

6. Copy the configuration file and modify

# cp support-files/my-large.cnf / etc/my.cnf# vim / etc/my.cnf

The increase is as follows:

Datadir = / data/mysql/3306/datainnodb_flush_log_at_trx_commit = 2innodb_file_per_table = ONskip_name_resolve = ON

View the configuration file:

Vim / etc/ my.cnf [client] port = 3306socket = / tmp/ mysql.sock [mysqld] port = 3306socket = / tmp/mysql.sockskip-external-lockingkey_buffer_size = 256Mmax_allowed_packet = 1Mtable_open_cache = 256sort_buffer_size = 1Mread_buffer_size = 1Mread_rnd_buffer_size = 4Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8queryroomcachesisize= 16Mthread_concurrency = 8log-bin=mysql-binbinlog _ format=mixedserver-id = 1datadir = / data/mysql/3306/datainnodb_data_home_dir = / data/mysql/3306/datainnodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir = / data/mysql/3306/datainnodb_buffer_pool_size = 256Minnodb_additional_mem_pool_size = 20Minnodb_log_file_size = 64Minnodb_log_buffer_size = 8Minnodb_flush_log_at_trx_commit = 2innodb_lock_wait_timeout = 50innodb_file_per _ table = ONskip_name_resolve = on [mysqldump] quickmax_allowed_packet = 16m [MySQL] no-auto- rehash [myisamchk] key_buffer_size = 128Msort_buffer_size = 128Mread_buffer = 2Mwrite_buffer = 2m [mysqlhotcopy] interactive-timeout

7. Initialize mysql

# scripts/mysql_install_db-user=mysql-basedir=/usr/local/mysql/-datadir=/data/mysql/3306/data/-defaults-file=/etc/my.cnf

View the initialization results:

# ls / data/mysql/3306/data/aria_log.00000001 ibdata1 ib_logfile1 mysql-bin.000001 mysql-bin.000003 mysql-bin.state testaria_log_control ib_logfile0 mysql mysql-bin.000002 mysql-bin.index performance_schema

8. Start the service

# cp support-files/mysql.server / etc/rc.d/init.d/mysqld# chmod + x / etc/rc.d/init.d/mysqld# chkconfig-- add mysqld# service mysqld start

9. Add environment variabl

# vim / etc/profileexport PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin

Reread environment variables

Source / etc/profile

10. Initialize database user table

# mysqlWelcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 4Server version: 10.1.22-MariaDB Source distributionCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.MariaDB [(none)] > use mysqlDatabase changedMariaDB [mysql] > delete from user where host='localhost.localdomain' or host='127.0.0.1' or host='::1' or user='';Query OK, 5 rows affected (0.00 sec)

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

Wechat

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

12
Report