CentOS7安装MySQL5.7
下载链接(指下载mysql源安装包)
wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
然后用yum安装mysql源
yum localinstall mysql57-community-release-el7-9.noarch.rpm
切换至这个目录cd etc/yum.repos.d/
然后检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*.community.*"
下面才开始装mysql
yum install mysql-community-server -y
(以下只保留了部分截图,只要没报错即可完成)
安装完可查看mysql默认密码
cat /var/log/mysqld.log #后面
启动mysql并检查其运行状态
service mysqld start //启动mysql服务
service mysqld status //查看mysql服务状态
还有mysql的登陆命令 mysql -u root -p