文章目录

CentOS7yum源中已经没有正常安装MySQL时的mysql-sever文件,需要去官网上下载:

1
2
3
4
5
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

# rpm -ivh mysql-community-release-el7-5.noarch.rpm

# yum install mysql-community-server

成功安装之后重启mysql服务

1
# systemctl restart mysqld.service

初次安装mysql是root账户是没有密码的

设置密码的方法

1
2
3
# mysql -uroot
mysql> set password for ‘root’@‘localhost’ = password('mypasswd');
mysql> exit
文章目录