Mysql ( mysql -u root -p访问mysql )


1.下载mysql源安装包

wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm


2.安装mysql源

yum localinstall mysql57-community-release-el7-11.noarch.rpm


3.查看是否安装成功

yum repolist enabled | grep "mysql.*-community.*"


4.这个指令可以修改安装版本(一般不用改,默认安装你的5.7)

vim /etc/yum.repos.d/mysql-community.repo


5.安装mysql

yum install mysql-community-server


6.启动MySql


启动

systemctl start mysqld

状态

systemctl status mysqld

重启

/bin/systemctl restart mysqld.service


7.开机自启

systemctl enable mysql

systemctl daemon-reload