当前位置:网站首页>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 表,会发现 % 是被添加进去的。


边栏推荐
- flutter Unable to load asset: assets/images/888. png
- 91. (cesium chapter) cesium rocket launch simulation
- 众昂矿业:发展以氟化工为主的特色化工产业具有先天优势
- Treatment of insufficient space in the root partition of armbain system
- Wechat personal small store one click opening assistant applet development
- Matplotlib常用设置
- Introduction and use of plantuml
- shell 流程控制
- 数字峰会人气火爆,城链科技引发新一轮商业变革
- 为什么PHP叫超文本预处理器
猜你喜欢
![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]

YOGA27多维一体电脑,兼具出色外观与高端配置

Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration

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

Matplotlib常用设置

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

Explain the use of locksupport in detail

Multiple smart pointers

2022 crane driver (limited to bridge crane) examination questions and simulation examination

Airserver latest win64 bit personal screen projection software
随机推荐
内存泄露和内存溢出的区别是什么?
微信个人小商店一键开通助手小程序开发
2022年起重机司机(限桥式起重机)考试试题及模拟考试
The difference between timer and scheduledthreadpoolexecutor
Rank ranking with MySQL 5.7
Istio、eBPF 和 RSocket Broker:深入研究服务网格
The digital summit is popular, and city chain technology has triggered a new round of business transformation
常见的二十种软件测试方法详解(史上最全)
Some abilities can't be learned from work. Look at this article, more than 90% of peers
建模和影视后期有什么关联?
Typescript enumeration
You probably haven't noticed the very important testing strategy in your work
若干互联网暴露面的收敛及处置建议
Airserver latest win64 bit personal screen projection software
神经网络物联网的发展趋势和未来方向
shell 自定义函数
云信小课堂 | IM及音视频中常见的认知误区
Explain the volatile keyword
STM32F030F4驱动TIM1637数码管芯片
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received