EAM系統(tǒng)架構(gòu)之二:MySQL數(shù)據(jù)庫(kù)安裝

1. 下載mysql二進(jìn)制版本到主節(jié)點(diǎn)服務(wù)器
[root@mysql_node1 ~]# wget http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.32-linux-glibc2.5-x86_64.tar.gz
[root@mysql_node1 ~]# tar zxvf mysql-5.6.32-linux-glibc2.5-x86_64.tar.gz
2. 創(chuàng)建mysql的默認(rèn)安裝目錄
[root@mysql_node1 ~]# tar zxvf mysql-5.6.32-linux-glibc2.5-x86_64.tar.gz
[root@mysql_node1 ~]# mkdir /usr/local/mysql
[root@mysql_node1 mysql-5.6.32-linux-glibc2.5-x86_64]# cp -R * /usr/local/mysql/
3. 安裝MySQL

3.1 編輯mysql的默認(rèn)配置文件

[root@mysql_node1 ~]# cd /usr/local/mysql/
[root@mysql_node1 mysql]# vim support-files/my-default.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = /usr/local/mysql
datadir = /data
port = 3306
server_id = 1
socket = /tmp/mysql.sock

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

3.2 初始化mysql數(shù)據(jù)庫(kù)

[root@mysql_node1 mysql]# cp support-files/my-default.cnf /etc/my.cnf 
[root@mysql_node1 mysql]# useradd -s /sbin/nologin -M mysql
[root@mysql_node1 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data --basedir=/usr/local/mysql/
[root@mysql_node1 mysql]# cd bin/
[root@mysql_node1 bin]# cp -R * /usr/bin/

3.3 啟動(dòng)mysql服務(wù)

[root@mysql_node1 data]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/
[root@mysql_node1 data]# /etc/init.d/mysql.server start
[root@mysql_node1 data]# /etc/init.d/mysql.server status
 SUCCESS! MySQL running (3155)

3.4 Mysql的data目錄設(shè)置為/data方便后期drbd進(jìn)行數(shù)據(jù)同步

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容