centos7.4安装MySQL5.7.17
2018/01/03    标签: linux    mysql    centos   

默认centos7.4安装了mysql

  1. 删除mysql

yum install numactl perl 
rpm -qa | grep mysql 
yum remove mysql-libs

2.清空/var/lib/mysql/文件夹下的文件

cd /var/lib/
rm -rf mysql

3.安装mysql

rpm -ivh mysql-community-common-5.7.17-1.el6.x8664.rpm 
rpm -ivh mysql-community-libs-5.7.17-1.el6.x8664.rpm 
rpm -ivh mysql-community-client-5.7.17-1.el6.x8664.rpm 
rpm -ivh mysql-community-server-5.7.17-1.el6.x8664.rpm

注意安装顺序不能颠倒

4.查看默认密码,并修改

cat /var/log/mysqld.log | grep "temporary password"

登陆mysql

mysql -u root -p ***

***为刚查到的密码

mysqladmin修改默认密码

mysqladmin -u root -p password abcdef


注:

mysql下载:http://mirrors.sohu.com/mysql/MySQL-5.7/