1、Yum安装MySql
MySQL官方的 Yum Repository
环境: Centos7 + MYSQL5.7
1.下载RPM包,并安装启动
惹失效--> 查看 https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-fresh-install
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum repolist enabled | grep mysql
yum -y install mysql-community-server
systemctl start mysqld && systemctl status mysqld && systemctl enable mysqld2.获取初始密码
grep "password" /var/log/mysqld.log
mysql -uroot -p # 回车后会提示输入密码3.修改密码
4.清除多余文件
Last updated