centos7yum安装mysql8.0.28
时间: 2023-05-02 19:04:58 浏览: 478
centos上利用yum安装mysql安装图解.pdf
首先需要配置MySQL的Yum存储库,然后执行以下命令安装MySQL 8.0.28:
1. sudo yum -y localinstall https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
2. sudo yum-config-manager --disable mysql80-community
3. sudo yum-config-manager --enable mysql57-community-dmr
4. sudo yum install -y mysql-community-server
安装完成后,启动MySQL服务并设置开机自启动:
1. sudo systemctl start mysqld.service
2. sudo systemctl enable mysqld.service
最后,使用以下命令登录MySQL并设置密码:
1. sudo mysql -u root
2. ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
阅读全文