您好,登錄后才能下訂單哦!
一、安裝依賴環境:
yum -y install libaio libaio-devel libtool make automake autoconf numactl numactl-devel bzip2 gcc gcc-c++ perl perl-DBI perl-ExtUtils-MakeMaker perl-devel perl-Time-HiRes perl-DBD-MySQL pcre-devel time jemalloc gperf cmake zlib-devel openssl-devel readline-devel readline glib2-devel mysql-devel qpress which netstat
wget
http://repositories.voole.com/jemalloc-4.0.4.tar.bz2
tar xjf jemalloc-4.0.4.tar.bz2
cd jemalloc-4.0.4
./autogen.sh
make && make install
echo '/usr/local/lib' >> /etc/ld.so.conf.d/local.conf
ldconfig
二、下載二進制包并部署:
cd /opt/soft
wget
http://repositories.voole.com/Percona-Server-5.7.21-20-Linux.x86_64.ssl101.tar.gz
tar zxvf Percona-Server-5.7.21-20-Linux.x86_64.ssl101.tar.gz
mv Percona-Server-5.7.21-20-Linux.x86_64.ssl101 /usr/local/mysql
三、創建mysql用戶組
groupadd mysql && useradd -g mysql -M -s /sbin/nologin mysql
四、創建數據庫文件my.cnf ,統一放到程序目錄里
mv /etc/my.cnf /etc/my.cnf.bak
SSD固態盤:wget
http://repositories.voole.com/my57_19.cnf
-O /etc/my.cnf
SATA磁盤:wget
http://repositories.voole.com/my57_19_sata.cnf
-O /etc/my.cnf
從庫:wget
http://repositories.voole.com/my_slave.cnf
-O /etc/my.cnf
主庫:wget
http://repositories.voole.com/my_master.cnf
-O /etc/my.cnf
五、初始化,記得加上配置文件
/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --initialize
六、設置環境變量
echo "export PATH=/usr/local/mysql/bin:$PATH">>/etc/profile && source /etc/profile
which mysql
七、修改屬主屬組
chown -R mysql.mysql /opt/mysql_data
八、啟動mysql5.7服務
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
/etc/init.d/mysql start
九、重置密碼(mysql5.7和其他版本不同、初次安裝會生成一個隨機密碼在/opt/mysql_data/logerr.err日志內)
密碼在logerr.err 中會默認生成一個
set password=password('123456');
如果需要再次修改root密碼
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
十、設置訪問權限
grant all on . to root@"%" identified by "mysql*()";
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。