tar -xvf mysql
解压后产生这些文件
按照common–>libs–>libs-compat–>client–>server的顺序依次安装组件
rpm -ivh mysql-community-common-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm
/usr/sbin/mysqld --initialize-insecure --user=mysql
/usr/sbin/mysqld --user=mysql&
mysql -uroot
alter user 'root'@'localhost' identified by '123456';
select user,host from user;#查询用户信息
update user set host='%' where host='localhost';#设置远程登录权限
flush privileges;#刷新配置信息