yum 安装MySQL8.0
时间: 2023-12-20 14:31:57 浏览: 70
以下是安装MySQL 8.0 的步骤:
1. 安装MySQL服务
```shell
yum install -y mysql-community-server
```
2. 检查安装的yum源是否存在
```shell
yum repolist enabled | grep mysql
```
3. 选择默认安装的版本,默认的是8.0版本
```shell
yum -y install yum-utils
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
yum repolist enabled | grep mysql
```
相关问题
yum安装mysql8.0
要使用yum安装MySQL 8.0,您需要按照以下步骤操作:
1. 首先,添加MySQL Yum存储库。您可以使用以下命令将MySQL的存储库添加到您的系统中:
yum -y install https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
2. 接下来,运行以下命令将服务器的包信息下载到本地电脑缓存起来:
yum makecache
3. 然后,使用yum安装MySQL Community Server:
sudo yum -y install mysql-community-server
这样就完成了MySQL 8.0的安装。请确保您已经备份了CentOS的yum源,并删除了已经安装的MySQL或mariadb版本。如果您还没有wget命令,可以通过运行以下命令来安装它:
yum -y install wget
然后,您可以使用wget命令下载MySQL的rpm包:
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
接下来,使用以下命令安装刚刚下载的rpm包:
rpm -ivh mysql80-community-release-el7-7.noarch.rpm
完成安装后,您可以设置新密码并重新启动MySQL。使用以下命令登录数据库并修改密码:
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
flush privileges;
然后,您可以重新登录并测试MySQL是否正常工作:
mysql -u root -p
这样,您就成功地使用yum安装了MySQL 8.0版本。请记住,在执行这些操作之前,确保您已经备份了相关的文件和数据。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Linux 用yum 安装MySQL 8.0.x](https://blog.csdn.net/wulei2921625957/article/details/112447267)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Yum安装MySQL8.0版本](https://blog.csdn.net/m0_67159981/article/details/129655038)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
yum 安装mysql8.0
要使用yum安装MySQL8.0,您可以按照以下步骤进行操作:
1. 首先,更新yum包管理器,以确保您拥有最新的软件包列表和依赖项:<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [yum安装MySQL8.0教程](https://blog.csdn.net/weixin_45351743/article/details/114288181)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文