mysql5.7二进制安装
centos7捆绑了mariadb-libs,所有必须先卸载
yum -y remove mari*
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
tar axf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
mkdir /home/mysql
mv mysql-5.7.25-linux-glibc2.12-x86_64 /home/mysql/
cd /home/mysql
ln -s mysql-5.7.25-linux-glibc2.12-x86_64/ mysql
useradd mysql -s /sbin/nologin
chown mysql.mysql /home/mysql/ -R
./mysql/bin/mysqld --basedir=/home/mysql/mysql --datadir=/home/mysql/data --initialize --user=mysql
cp mysql/support-files/mysql.server /etc/init.d/
sed -i 's#^basedir=$#basedir=/home/mysql/mysql#' /etc/init.d/mysql.server
sed -i 's#^datadir=$#datadir=/home/mysql/data#' /etc/init.d/mysql.server
/etc/init.d/mysql.server start
echo "PATH=/home/mysql/mysql/bin:$PATH" >/etc/profile.d/mysql.sh
source /etc/profile.d/mysql.sh
创建远程管理员账户
msyql>
create user 'admin'@'%' identified by 'xx';
grant all privileges on *.* to 'admin'@'%';
flush privileges;