IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> 使用 mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar在阿里云服务器使用CentOS 7进行安装 -> 正文阅读

[系统运维]使用 mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar在阿里云服务器使用CentOS 7进行安装

使用wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar下载所需的安装包。
下载完成
使用tar -xvf mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar进行解压。

在这里插入图片描述

使用rpm -ivh mysql-community-common-5.7.35-1.el7.x86_64.rpm进行安装的时候,报下边的错误:

warning: mysql-community-common-5.7.35-1.el7.x86_64.rpm: Header V3 DSA/SHA256 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
        file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/french/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/german/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/greek/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/italian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/japanese/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/korean/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/polish/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/romanian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/russian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/serbian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/slovak/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/spanish/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/swedish/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp1251.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64
        file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.35-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.60-1.el7_5.x86_64

使用rpm -qa | grep maria可以查看安装了maria开头的什么软件。
在这里插入图片描述
使用yum remove mariadb-libs-5.5.60-1.el7_5.x86_64进行卸载。
在这里插入图片描述
在这里插入图片描述
再次使用rpm -ivh mysql-community-common-5.7.35-1.el7.x86_64.rpm
在这里插入图片描述
使用rpm -ivh mysql-community-libs-5.7.35-1.el7.x86_64.rpm安装mysql-community-libs。
在这里插入图片描述
使用rpm -ivh mysql-community-client-5.7.35-1.el7.x86_64.rpm安装mysql-community-client。

在这里插入图片描述
使用rpm -ivh mysql-community-server-5.7.35-1.el7.x86_64.rpm安装的时候,报错:

warning: mysql-community-server-5.7.35-1.el7.x86_64.rpm: Header V3 DSA/SHA256 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        libaio.so.1()(64bit) is needed by mysql-community-server-5.7.35-1.el7.x86_64
        libaio.so.1(LIBAIO_0.1)(64bit) is needed by mysql-community-server-5.7.35-1.el7.x86_64
        libaio.so.1(LIBAIO_0.4)(64bit) is needed by mysql-community-server-5.7.35-1.el7.x86_64

在这里插入图片描述

使用yum search libaio查询一下可以安装的缺少的依赖包。
在这里插入图片描述
使用yum install libaio.x86_64 libaio-devel.x86_64 -y可以安装依赖包。
在这里插入图片描述
使用rpm -ivh mysql-community-server-5.7.35-1.el7.x86_64.rpm进行安装mysql-community-server,安装成功。
在这里插入图片描述
systemctl start mysqld启动MySQL客户端。
systemctl status mysqld查看MySQL客户端的状态。Active的状态是“active (running)”表明是正常启动。
在这里插入图片描述
使用grep "password" /var/log/mysqld.log可以查看随机生成的密码。
在这里插入图片描述
使用 mysql -uroot -p然后按回车键,输入密码之后再按回车键,正确的话就会显示下边这样类似的字样:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.35

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

在这里插入图片描述
mysql>是提示符,在后边可以输入SQL语句,比如显示所有的数据库show databases;但是发现报下边的问题:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

在这里插入图片描述
这个是要我先修改密码,就是将默认密码改成自己的密码。
使用ALTER USER '用户名'@'网址' IDENTIFIED BY '密码';进行设置,就像ALTER USER 'root'@'localhost' IDENTIFIED BY 'ILoveYou#123';这样,其中root是用户名,localhost使用网址,而ILoveYou#123是密码,注意密码需要有大小字母、数字和特殊字符组成,出现“Query OK”这样的字样就表明设置密码成功。
在这里插入图片描述
使用 exit;可以退出MySQL客户端。
在这里插入图片描述
使用mysql -u用户名 -p密码可以进入到MySQL客户端,例如mysql -uroot -pILoveYou#123
在这里插入图片描述
使用show databases;显示所有的数据库。
在这里插入图片描述
systemctl stop mysqld是关闭MySQL客户端的命令。然后再使用systemctl status mysqld查看的话, Active对应的值为“inactive (dead)”,就如下图所示:
在这里插入图片描述
有一个配置问题,我认为很重要:如何让远程ip也能访问MySQL客户端。
grant all privileges on *.* to 'root'@'%' identified by 'ILoveyou#3' with grant option;这个命令就是将所有的权限(*.*)通过用户(root)和密码“ILoveyou#3”赋给所有ip(“%”)。使用flush privileges;刷新MySQL的系统权限相关表,立即生效。
在这里插入图片描述
发现使用Navicat无法连接上。
在这里插入图片描述
进入到阿里云官网,然后找到对应的ECS实例,配置安全组规则。
在这里插入图片描述
点击配置规则。
在这里插入图片描述
点击快速添加。
在这里插入图片描述

首先选择“MySQL(3306)”,然后点击“确定”
在这里插入图片描述
再次用Navicat测试,发现成功了。
在这里插入图片描述

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-04-18 18:25:00  更:2022-04-18 18:25:04 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 22:40:06-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码