RED HAT ENTERPRISE LINUX7:
https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.25-el7-x86_64.tar
git clone --branch 5.3.0 https://github.com/jemalloc/jemalloc.git
tar xzvf jemalloc-4.5.0.tar
cd jemalloc-4.5.0
./autogen.sh
make
make install
-----------------------------
# 1. 下载MySQL Community Server 5.7.25
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
# 2. 解压tar包
tar -zxvf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
# 将解压后的文件夹移动到合适的位置,例如/usr/local
mv mysql-5.7.25-linux-glibc2.12-x86_64 /usr/local/mysql
# 3. 创建MySQL用户组和用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
yum install -y libaio.so.1
yum install -y libaio
# 4. 初始化MySQL
cd /usr/local/mysql
#bin/mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
/apps/svr/mysql/v5.7.25/bin/mysqld --initialize --user=mysql --defaults-file=/apps/conf/mysql/mysql57_3306.cnf --basedir=/apps/svr/mysql/v5.7.25 --datadir=/apps/dbdata/mysql_data/data57_3306
/apps/svr/mysql/v5.7.25/bin/mysqld --defaults-file=/apps/conf/mysql/mysql57_3306.cnf --initialize --user=mysql
初始密码在Log中。
A temporary password is generated for root@localhost: oL6#*W12;X2
A temporary password is generated for root@localhost: r#Fh=!.Y<1Dg
修改初始密码:
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
CREATE USER 'xx'@'192.168.10.%' IDENTIFIED BY 'mypasswordxx';
CREATE USER 'xx@'localhost' IDENTIFIED BY 'mypasswordxx';
grant all privileges on *.* to 'xx'@'192.168.10.%' identified by 'mypasswordxx';
grant all privileges on *.* to 'xx'@'localhost' identified by 'mypasswordxx';
REVOKE ALL ON *.* FROM 'xxx'@'192.168.10.%';
# 5. 安装MySQL服务
cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
# 添加MySQL服务
chkconfig --add mysql
# 启动MySQL服务
service mysql start
# 安全设置(可选)
/usr/local/mysql/bin/mysql_secure_installation