下载地址:https://dev.mysql.com/downloads/mysql/5.6.html#downloads
tar -zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
cd /usr/local/
ln -s mysql-5.7.22-linux-glibc2.12-x86_64 mysql
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
cd /usr/local/mysql
chown -R mysql:mysql ./
./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize
./support-files/mysql.server start
./support-files/mysql.server start
cp support-files/mysql.server /etc/init.d/mysqld
service mysqld restart
vi /etc/profile
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile
mysql -u root -p
alter user ‘root’@‘localhost’ identified by ‘root’;
use mysql
update user set user.Host=’%’ where user.User=‘root’;
select user,host from user;
flush privileges;