#author("2025-04-03T07:28:05+00:00","default:iseki","iseki")
#author("2025-04-03T07:31:20+00:00","default:iseki","iseki")
* Compile of MariaDB
** Install
*** Pre
<pre>
# yum install -y gnutls-devel
</pre>

*** Download
<pre>
# cd /usr/local/src
# wget ftp://www.nsl.tuis.ac.jp/pub/mariadb/mariadb-X.Y.Z.tar.gz
# zcat mariadb-X.Y.Z.tar.gz |tar xfv -
</pre>

*** Compile
<pre>
# cd mariadb-X.Y.Z
# mkdir build
# cd build
# cmake -DWITH_READLINE=true -DWITHOUT_TOKUDB_STORAGE_ENGINE=true -DHAVE_SYSTEMD=true ..
# make
# make install
# ls -l /usr/local
</pre>

** Setup
*** ユーザ作成
<pre>
# vipw                        # 確認
# adduser mysql -u 103 -d /var/lib/mysql -s /sbin/nologin
# \rm  /var/mysql/.b*         # B-Shell 関係のファイルを削除する
</pre>

*** ディレクトリのパーミッション
<pre>
# cd /usr/local
# chmod -R o+r mysql
# find mysql -type d |xargs chmod o+x
</pre>
*** 設定ファイル
<pre>
# vi /etc/my.cnf
# chmod a+r /etc/my.cnf
</pre>
**** /etc/my.cnf
<pre>
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mariadb.sock
socket=/var/lib/mysql/mysql.sock
</pre>
*** 起動スクリプト
 # cd /usr/local/src/mariadb-X.Y.Z/build
 # cp support-files/mariadb.service  /usr/lib/systemd/system
 # systemctl enable mariadb.service


*** 初期化
 # cd /usr/local/mysql
 # scripts/mysql_install_db  --user=mysql  --ldata=/var/lib/mysql  --basedir=/usr/local/mysql (or mariadb)

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 ページ一覧 検索 最終更新   ヘルプ   最終更新のRSS