yum -y install mysql57-community-release-el7-10.noarch.rpm
时间: 2023-05-02 16:02:22 浏览: 93
执行命令'b'yum -y install mysql57-community-release-el7-10.noarch.rpm''的目的是安装mysql57社区版本的rpm包,并将其安装在当前系统中。
相关问题
安装MySQL 1、执行以下命令,查询系统已安装的MariaDB rpm -qa|grep mariadb 2、执行以下命令,将查询到的MariaDB卸载 rpm -e --nodeps mariadb-libs-5.5.60-1.e17_5.x86_64 3、下载并安装MySQL yum -y install wget rpm -qa|grep 'wget' wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm sudo yum install mysql-server --nogpgcheck 4、执行以下命令启动MySQL服务 systemctl start mysqld.service 5、执行以下命令查看mysql状态 systemctl status mysqld.service 6、获取自动生成的密码 grep "password" /var/log/mysqld.log 7、登录MySQL mysql -uroot -p 8、修改密码 set global validate_password_policy=0; set global validate_password_length=4; set password=password("jqe6b6"); 9、设置MySQL可远程登录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'jqe6b6'; FLUSH PRIVILEGES;
好的,您的问题是如何在 CentOS 7 上安装并配置 MySQL。
以下是安装和配置 MySQL 的步骤:
1. 执行以下命令,查询系统已安装的 MariaDB:
```
rpm -qa | grep mariadb
```
2. 如果查询到 MariaDB,需要先卸载:
```
rpm -e --nodeps mariadb-libs-5.5.60-1.e17_5.x86_64
```
3. 安装 MySQL,执行以下命令:
```
yum -y install wget
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
sudo yum install mysql-server --nogpgcheck
```
4. 启动 MySQL 服务:
```
systemctl start mysqld.service
```
5. 查看 MySQL 服务状态:
```
systemctl status mysqld.service
```
6. 获取自动生成的密码:
```
grep "password" /var/log/mysqld.log
```
7. 登录 MySQL:
```
mysql -uroot -p
```
输入刚才获取到的密码进行登录。
8. 修改密码:
```
set global validate_password_policy=0;
set global validate_password_length=4;
set password=password("jqe6b6");
```
这里的 "jqe6b6" 是您设置的新密码,根据实际情况进行修改。
9. 设置 MySQL 可远程登录:
```
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'jqe6b6';
FLUSH PRIVILEGES;
```
这里的 "jqe6b6" 是您设置的新密码,根据实际情况进行修改。
至此,MySQL 的安装和配置就完成了。
warning: mysql80-community-release-el7-7.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] package mysql80-community-release-el8-1.noarch (which is newer than mysql80-community-release-el7-7.noarch) is already installed file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql from install of mysql80-community-release-el7-7.noarch conflicts with file from package mysql80-community-release-el8-1.noarch file /etc/yum.repos.d/mysql-community-source.repo from install of mysql80-community-release-el7-7.noarch conflicts with file from package mysql80-community-release-el8-1.noarch file /etc/yum.repos.d/mysql-community.repo from install of mysql80-community-release-el7-7.noarch conflicts with file from package mysql80-community-release-el8-1.noarch
这个错误提示是因为你的系统中已经安装了mysql80-community-release-el8-1.noarch的版本,而你现在又试图安装mysql80-community-release-el7-7.noarch的旧版本。这两个版本之间存在冲突,所以你需要先卸载mysql80-community-release-el8-1.noarch版本,然后再安装mysql80-community-release-el7-7.noarch版本。你可以使用以下命令卸载mysql80-community-release-el8-1.noarch版本:
```
sudo yum remove mysql80-community-release-el8-1.noarch
```
然后再尝试安装mysql80-community-release-el7-7.noarch版本。
阅读全文