参考链接:https://blog.csdn.net/huyangg/article/details/71308147
CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
# yum install mysql-community-server
成功安装之后重启mysql服务
# service mysqld restart
初次安装mysql是root账户是没有密码的
设置密码的方法
mysql> set password for ‘root’@‘localhost’ = password('mypasswd');