【正文】
localhost39。39。cupinn39。%39。 for help. Type 39。 identified by 39。root39。建議把上一步驟中 mysql初始化生成的/usr/local/mysql/ 刪除,然后把你優(yōu)化好的 mysql 配置文件 放到/etc 下。MySQL 源碼編譯安裝(+) 部署環(huán)境操作系統(tǒng):Boost庫版本: MySQL版本:操作用戶:root?系統(tǒng)IP:主機名:cpmysql01配置:4 核、4G 內(nèi)存 一、服務(wù)器配置:配置網(wǎng)絡(luò)? vi /etc/sysconfig/networkscripts/ifcfgeth0 設(shè)置主機名 vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=cpmysql01 設(shè)置 IP 與主機名的映射 vi /etc/hosts cpmysql01 cpmysql01 兩臺數(shù)據(jù)庫服務(wù)器的的 selinux 都要 disable?(永久關(guān)閉 selinux,請修改/etc/selinux/config,將 SELINUX 改為 disabled) vi /etc/selinux/configSELINUX=disabled 重啟操作系統(tǒng) reboot 二、源碼安裝 : 使用下面的命令檢查是否安裝有 MySQL Server: rpm qa | grep mysql如果是 CentOS7 以上,請使用以下命令查看: rpm qa | grep mariadb(因為沒有 MySQL 服務(wù),因此沒必要卸載。(這是做 mysql 主從復(fù)制和 mysql 優(yōu)化的經(jīng)驗!) (我們這里使用/etc/) 1編輯/etc/: vi /etc/ [client]defaultcharacterset=utf8port = 3306socket = /usr/local/mysql/[mysqld]charactersetserver = utf8 init_connect=39。 and host=39。39。\c39。 IDENTIFIED BY 39。39。localhost39。. 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 遠程登錄,可添加普通用戶, 然后設(shè)置允許遠程登錄 Success.By default, MySQL es with a database named 39。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 user account created for them. This is intended only fortesting, and to