vi /etc/yum.repos.d/mysql-community.repo 添加一下内容: [mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/ enabled1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
yum install mysql-community-server -y
systemctl start mysqld
grep 'temporary password' /var/log/mysqlg.log mysqladmin -u roo -p password # 回车,输入原始密码,在输入新的密码
mysql -uroot -p'密码'
gran all privileges on *.* to 'root'@'%' identified bby '密码' with grant option; flush privileges;