当前位置:网站首页>Linux基础 —— CentOS7 离线安装 MySQL
Linux基础 —— CentOS7 离线安装 MySQL
2022-07-01 22:52:00 【繁依Fanyi】
大数据系列文章:目录

一、安装前准备
1. MySQL rpm 包准备
① 打开 MySQL 下载页面,选择自己想要的版本即可
- MySQL 下载页面链接:https://dev.mysql.com/downloads/mysql/
- 阿里云 MySQL 镜像(推荐):https://mirrors.aliyun.com/mysql/?spm=a2c6h.13651104.0.0.712126b0xBBqsR

② 找到自己想要安装的版本,点击下载即可。

2. CentOS7 环境准备
详细安装方法可见下文:
| 内容 | 链接 |
|---|---|
| CentOS 安装 | 大数据环境搭建 —— CentOS 安装 |
3. XShell 与 Xftp
白嫖过程可见下文:
| 内容 | 链接 |
|---|---|
| 工具获取 — XShell | Linux基础 —— XShell 免费获取指南 |
二、开始安装
1. 卸载 MySQL
为了保险起见,防止之前安装过的 MySQL 与现在的 MySQL 产生冲突,就先卸载一遍 MySQL。
① 查看 MySQL 依赖
rpm -qa | grep mysql
如果找到什么,要进行下一步的卸载,如果没有,就不用了。

② 卸载 MySQL
rpm -e --nodeps `rpm -qa | grep mysql`
2. 发送 MySQL 安装包到节点主机上
① 建立 ftp 连接
这里使用 sftp 协议将文件传送到节点上,打开 xftp ,填写信息,建立链接。

② 发送安装包文件
将 MySQL 安装包拖入到想要放入的目录即可。

3. 安装 MySQL 安装包
cd 进入安装目录,安装 MySQL 安装包。
# rpm -ivh + 包名
rpm -ivh MySQL-server-5.1.73-1.glibc23.x86_64.rpm
rpm -ivh MySQL-client-5.1.73-1.glibc23.x86_64.rpm
三、简单配置
1. 配置开机启动
service mysql start
chkconfig mysql on
2. 修改 MySQL 密码
由于这里安装的是 5.6 以下版本,下面的操作只对 5.6 以下版本可行
① 输入 mysql 进入 MySQL
mysql
② 操作数据库修改密码
use mysql; # 切换数据库
user set password=password('123456') where user='root' and host='localhost'; # 修改密码为 123456
flush privileges # 配置生效
exit #退出 MySQL
3. 配置允许远程访问
use mysql; # 切换数据库
update user set host = '%' where user = 'root'; # 配置允许远程主机访问 root
flush privileges # 配置生效
如果报错可以忽略,再次查询 user 表,会发现 % 是被添加进去的。


边栏推荐
- The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received
- CKS CKA CKAD 将终端更改为远程桌面
- URL 介绍
- Jerry's records are powered by Vbat with a power supply voltage of 4.2V [chapter]
- 通过Go语言创建CA与签发证书
- 数字峰会人气火爆,城链科技引发新一轮商业变革
- What is the relationship between modeling and later film and television?
- 玻璃马赛克
- SWT/ANR问题--SWT 导致 kernel fuse deadlock
- 证券开户选哪个证券公司比较好,哪个更安全
猜你喜欢

You probably haven't noticed the very important testing strategy in your work

Glass mosaic
![Compare the version number [double pointer to intercept the string you want]](/img/19/4f858ffdc1281d6b8b18a996467f10.png)
Compare the version number [double pointer to intercept the string you want]

window10安装wsl(一)(WslRegisterDistribution ERROR)

2022 safety officer-c certificate examination question simulation examination question bank and simulation examination

Programming English vocabulary notebook

Cisco -- highly available and reliable network examination

Explain JMM in detail

flutter Unable to load asset: assets/images/888. png

Copy ‘XXXX‘ to effectively final temp variable
随机推荐
每日三题 6.28
若干互联网暴露面的收敛及处置建议
SWT/ANR问题--SWT 导致 kernel fuse deadlock
微服务服务稳定性治理
What is mosaic?
Create Ca and issue certificate through go language
Win 10 mstsc connect RemoteApp
URL 介绍
Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
通过Go语言创建CA与签发证书
Groups and ranges of regular series
2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
内存泄露和内存溢出的区别是什么?
flutter Unable to load asset: assets/images/888.png
转行软件测试,知道这四点就够了!
Data enhancement of semi supervised learning
Typescript enumeration
AirServer最新Win64位个人版投屏软件
共享电商的背后: 共创、共生、共享、共富,共赢的共富精神
Convergence and disposal suggestions of some Internet exposure surfaces