【正文】
這個(gè)文件:rm /etc/ 如果你需要用于生產(chǎn)環(huán)境,不要急著做下面的 mysql 啟動(dòng)操作。localhost39。39。cupinn39。. This ensures that someone cannot guess atthe root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y 一般不允許 root 遠(yuǎn)程登錄,可添加普通用戶, 然后設(shè)置允許遠(yuǎn)程登錄 Success.By default, MySQL es with a database named 39。39。\c39。 and host=39。MySQL 源碼編譯安裝(+) 部署環(huán)境操作系統(tǒng):Boost庫(kù)版本: MySQL版本:操作用戶:root?系統(tǒng)IP:主機(jī)名:cpmysql01配置:4 核、4G 內(nèi)存 一、服務(wù)器配置:配置網(wǎng)絡(luò)? vi /etc/sysconfig/networkscripts/ifcfgeth0 設(shè)置主機(jī)名 vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=cpmysql01 設(shè)置 IP 與主機(jī)名的映射 vi /etc/hosts cpmysql01 cpmysql01 兩臺(tái)數(shù)據(jù)庫(kù)服務(wù)器的的 selinux 都要 disable?(永久關(guān)閉 selinux,請(qǐng)修改/etc/selinux/config,將 SELINUX 改為 disabled) vi /etc/selinux/configSELINUX=disabled 重啟操作系統(tǒng) reboot 二、源碼安裝 : 使用下面的命令檢查是否安裝有 MySQL Server: rpm qa | grep mysql如果是 CentOS7 以上,請(qǐng)使用以下命令查看: rpm qa | grep mariadb(因?yàn)闆](méi)有 MySQL 服務(wù),因此沒(méi)必要卸載。root39。 for help. Type 39。cupinn39。localhost39。39。%39。 identified by 39。建議把上一步驟中 mysql初始化生成的/usr/local/mysql/ 刪除,然后把你優(yōu)化好的 mysql 配置文件 放到/etc 下。(這是做 mysql 主從復(fù)制和 mysql 優(yōu)化的經(jīng)驗(yàn)!) (我們這里使用/etc/) 1編輯/etc/: vi /etc/ [client]defaultcharacterset=utf8port = 3306socket = /usr/local/mysql/[mysqld]charactersetserver = utf8 init_connect=39。39。 IDENTIFIED BY 39。localhost39。Securing the MySQL server deployment.Enter password for user root: VALIDATE PASSWORD PLUGIN can be used to test passwordsand improve security. It checks the strength of passwordand allows the users to set only those passwords which aresecure enough. Would you like to setup VALIDATE PASSWORD plugin?Press y|Y for Yes, any other key for No: n 密碼復(fù)雜度插件,這里設(shè)置不需要nUsing existing password for root.Change the password for root ? ((Press y|Y for Yes, any other key for No) : n 上已為 root 設(shè)置了密碼,此處可輸 n ... skipping.By default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to havea us