mariadb-10.1.22 Source Code Compilation installation
Download File https://mariadb.com/
1. Install the development environment
Yum Groupinstall "Development Tools"
Package Required for installation:
Yum install-y ncurses-devel Openssl-devel OpenSSL
2. Installing CMake
TAR-XF cmake-3.8.0.tar.gzcd Cmake-3.8.0./bootstrapmakemake Install
3. Preparation before installation
3.1. Prepare the Catalogue
Mkdir-pv/data/mysql/3306/{data,logs/{binlog,relaylog}}
3.2. Add Users
Useradd-s/sbin/nologin-g mysql-m Mysqlchown mysql:mysql/data/mysql/3306/-R
4. Compiling the 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-dsysconfdir=/etc-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. Preparation of 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
Add the following:
DataDir =/data/mysql/3306/datainnodb_flush_log_at_trx_commit = 2innodb_file_per_table = ONskip_name_resolve = On
To 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 = 8query_cache_size= 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
To view the results of the initialization:
# ls/data/mysql/3306/data/aria_log.00000001 ibdata1 ib_logfile1 mysql-bin.000001 mysql-bin.000003 mysql-bin.stat E 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# Servi Ce mysqld Start
9. Add Environment variables
# 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. Initializing the 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), 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 H ost= ' 127.0.0.1 ' or host= ':: 1 ' or user= '; Query OK, 5 rows Affected (0.00 sec)
This article is from the "take a deep Breath again" blog, make sure to keep this source http://ckl893.blog.51cto.com/8827818/1920592
Centos7 compile and install mariadb-10.1.22