linux mysql5.5 一主多从配置
安裝前必須刪除原來的安裝
需要檢查 以下文件是否存在 ,如果存儲(chǔ)則要?jiǎng)h除之
/etc/my.cnf
/etc/init.d/mysqld
mysql 依賴的庫
shell> yum search libaio # search for info
shell> yum install libaio # install library
創(chuàng)建mysql 與用戶組,-s /bin/false 表示該用戶不能登錄
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
解壓安裝包至指定目錄
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
為 mysql 用戶添加權(quán)限
shell> chown -R mysql ./
shell> chgrp -R mysql ./
#創(chuàng)建data目錄并添加權(quán)限
shell> mkdir -p /data/mysql
shell> chown -R mysql:mysql /data/mysql
拷貝配置文件
shell> cp ${basedir}/support-files/my-medium.cnf /etc/my.cnf
#修改配置
[mysqld]
basedir=/home/cbt/svr/mysql
datadir=/data/mysql
character-set-server=utf8
shell> cp support-files/mysql.server /etc/init.d/mysql
#添加環(huán)境變量
shell> vi /etc/profile
PATH=/home/cbt/svr/mysql/bin:$PATH
export PATH
#讓剛才的修改生效
shell> source /etc/profile
啟動(dòng)及其它配置 #啟動(dòng)數(shù)據(jù)庫
service mysql start
#開機(jī)啟動(dòng)
chkconfig mysqld on
#初始化mysql的一些設(shè)置
mysql_secure_installation
#回車
Enter current password for root (enter for none):
#y,設(shè)置mysql的root密碼
Set root password?[Y/n] y
#以下都yes
Remove anonymous users?[Y/n] y
Disallow root login remotely?[Y/n] y
Remove test database and access to it?[Y/n] y
Reload privilege tables now?[Y/n] y
ThanksforusingMySQL!
允許遠(yuǎn)程登陸
?
總結(jié)
以上是生活随笔為你收集整理的linux mysql5.5 一主多从配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: samba服务器配置及使用
- 下一篇: yml配置
