mariadb-10.1.22 源碼編譯安裝
成都創(chuàng)新互聯(lián)提供高防服務(wù)器租用、云服務(wù)器、香港服務(wù)器、珉田數(shù)據(jù)中心等下載文件https://mariadb.com/
1.安裝開發(fā)環(huán)境
yum groupinstall "Development Tools"安裝需要包:
yum install -y ncurses-devel openssl-devel openssl2.安裝cmake
tar -xf cmake-3.8.0.tar.gz cd cmake-3.8.0 ./bootstrap make make install3.安裝前準(zhǔn)備
3.1.準(zhǔn)備目錄
mkdir -pv /data/mysql/3306/{data,logs/{binlog,relaylog}}3.2.添加用戶
groupadd mysql useradd -s /sbin/nologin -g mysql -M mysql chown mysql:mysql /data/mysql/3306/ -R4.編譯安裝
# 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 install5.安裝完環(huán)境準(zhǔn)備
# chmod +w /usr/local/mysql/ # chown -R mysql:mysql /usr/local/mysql/6.拷貝配置文件并修改
# cp support-files/my-large.cnf /etc/my.cnf# vim /etc/my.cnf增加如下:
datadir = /data/mysql/3306/data innodb_flush_log_at_trx_commit = 2 innodb_file_per_table = ON skip_name_resolve = ON查看配置文件:
vim /etc/my.cnf [client] port = 3306 socket = /tmp/mysql.sock [mysqld] port = 3306 socket = /tmp/mysql.sock skip-external-locking key_buffer_size = 256M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M thread_concurrency = 8 log-bin=mysql-bin binlog_format=mixed server-id = 1 datadir = /data/mysql/3306/data innodb_data_home_dir = /data/mysql/3306/data innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /data/mysql/3306/data innodb_buffer_pool_size = 256M innodb_additional_mem_pool_size = 20M innodb_log_file_size = 64M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 2 innodb_lock_wait_timeout = 50 innodb_file_per_table = ON skip_name_resolve = ON [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout7.初始化mysql
# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/3306/data/ --defaults-file=/etc/my.cnf查看初始化結(jié)果:
# ls /data/mysql/3306/data/ aria_log.00000001 ibdata1 ib_logfile1 mysql-bin.000001 mysql-bin.000003 mysql-bin.state test aria_log_control ib_logfile0 mysql mysql-bin.000002 mysql-bin.index performance_schema8.啟動(dòng)服務(wù)
# cp support-files/mysql.server /etc/rc.d/init.d/mysqld # chmod +x /etc/rc.d/init.d/mysqld # chkconfig --add mysqld # service mysqld start9.添加環(huán)境變量
# vim /etc/profile export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin重讀環(huán)境變量
source /etc/profile10.初始化數(shù)據(jù)庫(kù)用戶表
# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.1.22-MariaDB Source distribution Copyright (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 mysql Database changed MariaDB [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)另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
新聞名稱:Centos7編譯安裝mariadb-10.1.22-創(chuàng)新互聯(lián)
標(biāo)題來源:http://jinyejixie.com/article30/dpespo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、服務(wù)器托管、ChatGPT、微信小程序、網(wǎng)站設(shè)計(jì)、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容