1.Centos7下找不到MySQL-server的安装包,这时候应该去官网下载
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
2.安装mysql
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
3.启动mysql
service mysql start
重新启动是 service mysql restart
4.mysql设置root用户的密码
(1)刚装好的mysql是没有密码的登录命令
mysql -u root
(2)修改命令用户密码的命令
set password for ‘root’@‘localhost’ = password(‘mypasswd’);