資源描述:
《Mysql數(shù)據(jù)庫(kù)安裝及生產(chǎn)環(huán)境下主從庫(kù)同步配置》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。
1、Mysql數(shù)據(jù)庫(kù)安裝及生產(chǎn)環(huán)境下主從庫(kù)同步配置第8頁(yè)目錄1安裝Mysql數(shù)據(jù)庫(kù)22生產(chǎn)環(huán)境下MySQL數(shù)據(jù)庫(kù)主從同步配置52.1主數(shù)據(jù)庫(kù)配置…………………………………………………………………………………………………...52.2從數(shù)據(jù)庫(kù)配置……………………………………………………………………………………………………53監(jiān)控服務(wù)器63.1監(jiān)控主數(shù)據(jù)庫(kù)服務(wù)器…………………………………………………………………………………………...63.2監(jiān)控從數(shù)據(jù)庫(kù)服務(wù)器………………………………………………………………………………………...6第8頁(yè)1安裝Mysql數(shù)據(jù)庫(kù)安裝環(huán)境:系統(tǒng):Ce
2、ntOS-6.6-x86_64數(shù)據(jù)庫(kù):MySQL-server-5.5.42-1.el6.x86_64;MySQL-client-5.5.42-1.el6.x86_641.SSH方式登錄到MySQL服務(wù)器2.創(chuàng)建存放安裝文件的目錄[root@localhost/]#mkdir-p/sw/mysql553.上傳安裝文件到上一步創(chuàng)建的目錄4.檢查是否已安裝過(guò)MySQL[root@localhost/]#rpm-qa
3、grep-imysqlMySQL-client-5.5.42-1.el6.x86_64MySQL-server-5.5.42-1.el6.x86_645.如果已安
4、裝則移除,否則請(qǐng)?zhí)^(guò)此步[root@localhost/]#yum-yremoveMySQL-server-5.5.42-1.el6.x86_64[root@localhost/]#yum-yremoveMySQL-client-5.5.42-1.el6.x86_64刪除老版本mysql的開(kāi)發(fā)頭文件和庫(kù)rm-fr/usr/lib/mysqlrm-fr/usr/include/mysqlrm-fr/var/lib/mysqlrm-f/etc/my.cnf6.安裝MySQL[root@localhost/]#cd/sw/mysql55/[root@localhostmysql
5、55]#rpm-ivhMySQL-server-5.5.42-1.el6.x86_64.rpmPreparing...###########################################[100%]1:MySQL-client###########################################[100%][root@localhostmysql55]#rpm-ivhMySQL-client-5.5.42-1.el6.x86_64.rpmPreparing...#######################################
6、####[100%]1:MySQL-server###########################################[100%]7.配置MySQL[root@localhostmysql55]#cp/usr/share/mysql/my-small.cnf/etc/my.cnf[root@localhostmysql55]#vi/etc/my.cnf[client]#password=your_passwordport=8819socket=/var/lib/mysql/mysql.sockdefault-character-set=utf8[mysql
7、d]port=8819socket=/var/lib/mysql/mysql.socklower_case_table_names=1第8頁(yè)skip-external-lockingkey_buffer_size=384Mmax_allowed_packet=8Mtable_open_cache=512sort_buffer_size=2Mread_buffer_size=2Mread_rnd_buffer_size=8Mmyisam_sort_buffer_size=64Mthread_cache_size=8Mquery_cache_size=32M#Trynumbe
8、rofCPU's*2forthread_concurrencythread_concurrency=16max_connections=10000character-set-server=utf8wait_timeout=31536000interactive_timeout=31536000user=mysqldefault_storage_engine=InnoDBpid-file=/var/lib/mysql/mysql.piddatadir=/var/lib/mysql/log_bin=/var/lib/mysql/m