---
title: "centos7 安装mysql5.7.17"
author: "fuaotech"
date: "2017-02-28T23:17:40Z"
tags: []
categories: ["数据库"]
slug: "centos7-mysql5-7-17"
draft: false
lastmod: "2017-02-28T23:22:58Z"
id: 2359578
url: "https://fuaotech.iteye.com/blog/2359578"
---

# [Centos7下安装mysql5.7.17](http://www.cnblogs.com/yanghuabin/p/6102709.html)

 

mysql的安装（root用户下）

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

安装时候会提示与已经安装的RPM包有冲突，所以我们先卸载一些RPM包，要卸载哪些呢？我们要卸载的是包含有mariadb关键字的RPM包，执行命令：rpm -qa|grep mariadb来查看一下我们要卸载哪些软件

 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;