Centos7 install mysql5.7.17

Install mysql5.7.17 under Centos7

 

MySQL installation (under root user)

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar

 

 

tar -xvf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar

When installing, it will prompt a conflict with the installed RPM package, so let's uninstall some RPM packages first. Which ones should be uninstalled? What we want to uninstall is the RPM package that contains the mariadb keyword, execute the command: rpm -qa|grep mariadb to see which software we want to uninstall

 rpm -qa | grep mariadb

 rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64

 rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm

 rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm

 libnuma.so.1()(64bit) is needed by mysql

 yum install numactl

 rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

 

mysqld --initialize --user=mysql

systemctl start mysqld

cat /var/log/mysqld.log

[Note] A temporary password is generated for root@localhost: gaYwAX?!k5nw

 mysql -uroot -p

systemctl enable mysqld.service

service mysqld status

service mysqld stop

service mysqld start

grant all privileges on *.*  to 'root'@'%' identified by 'pwd12345';

flush privileges;

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326398073&siteId=291194637