- 进入linux某个文件夹下, 然后去https://dev.mysql.com/downloads/mysql/5.7.html 用 wget 下载 mysql的rpm包
- mysql-community-client-5.7.33-1.el7.x86_64.rpm
- mysql-community-common-5.7.33-1.el7.x86_64.rpm
- mysql-community-libs-5.7.33-1.el7.x86_64.rpm
- mysql-community-server-5.7.33-1.el7.x86_64.rpm
- 然后用yum -y install mysql* 安装myql
- 启动mysql service mysqld start
- 查看mysql初始密码 grep "password" /var/log/mysqld.log
- 连接上以后需要重新设置密码: set password for root@localhost = password('Root@123456');