服務(wù)項(xiàng)目:網(wǎng)站建設(shè)、仿站、程序開發(fā)、APP開發(fā)設(shè)計(jì)、移動(dòng)網(wǎng)站開發(fā)設(shè)計(jì)、企業(yè)網(wǎng)站設(shè)計(jì)、電子商務(wù)網(wǎng)站開發(fā)、網(wǎng)站維護(hù)、網(wǎng)站推廣、UX/UI 、HTML5、CSS3、JS / Jquery ...
四川???萍加邢薰?></a></div>
                    <div   id=四川浚??萍加邢薰? title=
四川???萍加邢薰?(開發(fā)設(shè)計(jì)官網(wǎng))TEL : 15308000360 / QQ : 38585404

您的位置:首頁 > 技術(shù)經(jīng)驗(yàn) > 服務(wù)器 > 正文

centos6.5 6.6 6.7系統(tǒng)編譯安裝mariadb
技術(shù)支持服務(wù)電話:15308000360 【7x24提供運(yùn)維服務(wù),解決各類系統(tǒng)/軟硬件疑難技術(shù)問題】

MariaDB數(shù)據(jù)庫管理系統(tǒng)是 MySQL 的一個(gè)分支,主要由開源社區(qū)在維護(hù),采用GPL 授權(quán)許可。開發(fā)這個(gè)分支的原因之一是: 甲骨文公司 收購了MySQL后,有將MySQL 閉源 的潛在風(fēng)險(xiǎn),因此社區(qū)采用分支的方式來避開這個(gè)風(fēng)險(xiǎn)。

MariaDB的目的是完全兼容MySQL,包括 API 和命令行,使之能輕松成為MySQL的代替品。在存儲(chǔ)引擎方面,10.0.9版起使用 XtraDB (名稱代號(hào)為 Aria )來代替MySQL的 InnoDB 。

1.創(chuàng)建mysql普通賬號(hào),設(shè)置數(shù)據(jù)庫存儲(chǔ)數(shù)據(jù)的目錄,設(shè)置權(quán)限。

[root@DB ~]# groupadd -r mysql
[root@DB ~]# useradd -r -g mysql -s /sbin/nologin mysql
[root@DB ~]# mkdir -p /data/mydata
[root@DB ~]#  chown -R mysql:mysql /data

2.安裝一下數(shù)據(jù)庫依賴的一些軟件包。

yum install -y gcc gcc-c++ make cmake ncurses ncurses libxml2 libxml2-devel openssl-devel bison bison-devel ncurses-devel

3.下載Mariadb源碼包,解壓,編譯,安裝。

[root@DB ~]# mkdir -p /taokey/tools
[root@DB ~]# cd /taokey/tools/
[root@DB tools]# wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.1.8/source/mariadb-10.1.8.tar.gz
[root@DB tools]# tar -zxf mariadb-galera-10.1.8.tar.gz
[root@DB tools]# cd mariadb-10.1.8/
[root@DB mariadb-10.1.8]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/www/data -DSYSCONFDIR=/usr/lcoal/mysql/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STPRAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWIYH_READLINE=1 -DWIYH_SSL=system -DVITH_ZLIB=system -DWITH_LOBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
[root@DB mariadb-10.1.8]# make && make install

4.拷貝數(shù)據(jù)庫啟動(dòng)腳本到/etc/rc.d/init.d/mysqld目錄下,修改/etc/my.cnf配置文件。

[root@DB mariadb-10.1.8]# cd /usr/local/mysql/
[root@DB mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@DB mysql]# chmod +x /etc/rc.d/init.d/mysqld
[root@DB mysql]# cp support-files/my-large.cnf etc/my.cnf 
cp: overwrite `/etc/my.cnf'? yes
[root@DB mysql]# vim /etc/my.cnf +42
datadir = /www/data

5.初始化數(shù)據(jù)庫,啟動(dòng)數(shù)據(jù)庫。

[root@DB mysql]# scripts/mysql_install_db --user=mysql --datadir=/www/data/
[root@DB mysql]# service mysqld start
Starting MySQL.. SUCCESS!

6.設(shè)置數(shù)據(jù)庫的系統(tǒng)變量。

[root@DB mysql]# cat /etc/profile.d/mysqld.sh 
export PATH=$PATH:/usr/local/mysql/bin
[root@DB mysql]# source /etc/profile.d/mysqld.sh
[root@DB mysql]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.1.8-MariaDB-wsrep-log Source distribution, wsrep_25.10.r4144

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

安裝完成。



上一篇:PHP編譯安裝時(shí)常見錯(cuò)誤解決辦法
下一篇:apache php升級(jí)后httpd不啟動(dòng)的解決辦法

相關(guān)熱詞搜索:centos mariadb