centos7 mysql 5.7 官网下载tar安装
https://dev.mysql.com/downloads/mysql/5.7.html#downloads
下载好上传到服务器,解压后以此安装
libs,client,server三个rpm
rpm -ivh mysql-community-common-5.7.25-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.25-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.25-1.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm
去/var/log/mysqld.log找root登录密码
重置密码,最后记得授权root用户权限
mysql> set global validate_password_policy=0; Query OK, 0 rows affected (0.00 sec) mysql> set global validate_password_length=1; Query OK, 0 rows affected (0.01 sec) mysql> mysql> mysql> alter user 'root'@'localhost' identified by 'root'; Query OK, 0 rows affected (0.00 sec)
授权root用户权限
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; Query OK, 0 rows affected, 1 warning (0.00 sec)