centos7 安装mysql8.0
时间: 2023-04-11 17:01:34 浏览: 86
Centos7安装mysql8.0
可以通过以下步骤安装mysql8.0:
1. 添加mysql8.0的yum源
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
2. 安装mysql8.0
sudo yum install mysql-community-server
3. 启动mysql服务
sudo systemctl start mysqld
4. 设置mysql开机自启
sudo systemctl enable mysqld
5. 查看mysql初始密码
sudo grep 'temporary password' /var/log/mysqld.log
6. 登录mysql
mysql -u root -p
7. 修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
注意:在修改密码时,需要将new_password替换为你自己的密码。
阅读全文