1.首先从官网下载安装mysql-serve
# 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
2.安装成功后,重启mysql:
# service mysqld restart
如果忘记密码请点击下方链接:
https://blog.csdn.net/cm15835106905/article/details/104991058
3.设置密码:
mysql>set password for ‘root‘@'localhost' =password(‘password');