[root@localhost /]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)

指定yum源,
[root@WebServer ~]# vi /etc/yum.repos.d/rhel-source.repo
区分大小写,不要出错

新建以下内容
固定格式:[rhel-source-local]
给yum源起个名字:name=Red Hat Enterprise Linux 6.4
yrm源地址,挂载到:baseurl=file:///mnt/cdrom/Server
启用状态:enabled=1
软件包签名检查:gpgcheck=1
数字签名的公钥位置:gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

创建目录
[root@localhost /]#mkdir /mnt/cdrom
挂载到,新建目录下
[root@localhost /]#mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only

这时因为/mnt/cdrom只是一个目录,并不是你要挂载的光驱。
你要挂载光驱的话,应该是:
mount /dev/cdrom /mnt/cdrom
表示将设备/dev/cdrom挂载到/mnt/cdrom这个目录,挂在完成后就可以到/mnt/cdrom下浏览光盘中的文件了。
或者直接使用mount /dev/cdrom也行,Redhat会自动挂将光盘载到/mnt/cdrom上的。

查看挂载是否正确,
[root@localhost dev]# ll /mnt/cdrom/Server/
total 108
-r–r--r–. 2 root root 105446 Jan 31 2013 listing
dr-xr-xr-x. 2 root root 4096 Jan 31 2013 repodata
-r–r--r–. 1 root root 439 Jan 31 2013 TRANS.TBL

列出yum 源
[root@localhost /]#yum repolist
查看 MySQL 相关的包
[root@localhost /]#yum list | grep mysql
安装 MySQL server
[root@localhost /]#yum install -y mysql-server

检查服务
[root@localhost /]#chkconfig
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off

配置MySQL 开机自动运行
[root@localhost /]#chkconfig mysqld on

检查服务
[root@localhost /]#chkconfig
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

首次启动MySQL 服务
[root@localhost /]#service mysqld start

Initializing MySQL database: Installing MySQL system tables…
OK
Filling help tables…
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]

查看 3306 端口 是否处于监听状态,
[root@localhost /]#netstat -an | grep :3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

使用telnet 测试 3306端口,提示:连接失败,是因为防火墙阻止,需要打开防火墙
C:\WINDOWS\system32>telnet 192.168.231.131 3306
正在连接192.168.231.131…无法打开到主机的连接。 在端口 3306: 连接失败

查看防火墙当前设置,
[root@localhost /]#iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp – anywhere anywhere
ACCEPT all – anywhere anywhere
ACCEPT tcp – anywhere anywhere state NEW tcp dpt:ssh
REJECT all – anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all – anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination

添加 MySQL 防火墙放行动作
[root@localhost /]#iptables -t filter -I INPUT -p tcp --dport 3306 -j ACCEPT

iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp – anywhere anywhere tcp dpt:mysql

使用telnet 测试 防火墙是否放行 MySQL,
C:\WINDOWS\system32>telnet 192.168.231.131 3306
FHost ‘192.168.231.1’ is not allowed to connect to this MySQL server
遗失对主机的连接。
C:\WINDOWS\system32>
虽然没反应,但只要不提示“连接失败”,就说明,没问题

保存对防火墙的设置,否则重新启动后配置丢失,
[root@localhost /]# /etc/rc.d/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

至此,完成 红帽系统安装 MySQL 数据库。

January the 29th 2022 Saturday

红帽 Linux Redhat6.4安装MySQL 5.1相关推荐

  1. liunx tar安装mysql_在Linux下,安装Mysql(tar)

    在Linux下,安装Mysql(tar) # cd /home/tmp (进入压缩包所在目录) # groupadd mysql (建立mysql组) # useradd -g mysql mysql ...

  2. Linux源码安装mysql 5.6.12(cmake编译)

    转载链接:http://www.2cto.com/database/201307/229260.html Linux源码安装mysql 5.6.12(cmake编译) 1.安装make编译器(默认系统 ...

  3. Windows10系统的Linux子系统中安装MySQL数据库心得

    后端开发童鞋们, 自己开发机用的是Windows系统电脑(台式机或笔记本), 而开发的程序和使用的数据库等要运行在Linux服务器上, 这种情况有木有? 提前声明: 本文并不讨论操作系统的比较, 以及 ...

  4. Linux环境下安装MySQL(源码安装)

    Linux环境下安装MySQL(源码安装) 1.事先从官网/国内镜像站点中下载源码安装包,上传至服务器: 2.安装开发工具和开发包(从5.5开始使用cmake编译) 3.创建用户和组 4.编译安装My ...

  5. 红帽linux 虚拟机的安装

    本文章为我自行安装过程 ,如有问题,请大家积极指出! 安装前准备工具: VMware 红帽linux系统 6 安装步骤 1.运行VMware软件 2. 在主页中选择"创建新的虚拟机" ...

  6. linux怎么用源码安装mysql,Linux源码安装mysql步骤

    创建文件夹: mkdir  /usr/local/webserver 安装必要依赖包 yum -y install gcc gcc-c++ make ncurses-devel 安装cmake包: t ...

  7. Linux下编译安装MySQL安装

    Linux下编译安装MySQL安装 博主邮箱www.zzher@foxmail.com   qq:1102471911 编译安装MySQL 准备工作: 1.获得以下所需的源代码包,并存放在/usr/l ...

  8. 在linux下离线安装MySQL

    在linux下离线安装MySQL 首先从官网下载rpm离线包,然后解压到linux下 放到linux下之后,解压到任意目录下 tar xf mysql-5.7.35-1.el7.x86_64.rpm- ...

  9. 查询linux安装了什么数据库,Linux系统中安装MySQL数据库操作手册

    Linux系统中MySQL数据库安装手册 一.安装概述: 在Linux操作系统中安装MySQL数据库是一个我们必须要掌握的一门技术,也决定了你以后找工作的薪资待遇,所以你知道它的厉害了吧!学会安装只是 ...

  10. 在linux下怎么安装mysql,手把手教你在Linux系统下安装MySQL

    在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB. 1. 下载并安装MySQL官方的 Yum R ...

最新文章

  1. Emacs 使用YASnippet
  2. 玩转 iOS 开发:《iOS 设计模式 — 工厂模式》
  3. 利用numpy对已知样本点进行多项式拟合
  4. 不允许一个迭代的对象自己接着迭代下去(Python)【fronzenset】
  5. SD-SD用到的文本对象列表
  6. 优化order by语句
  7. 【面试题 - 最大值减去最小值小于或等于 num 的子数组数量】滑动窗口
  8. C++和Lua交互教程(基于LuaBridge)
  9. mysql重启.....
  10. 对 Lotus Notes 邮件模版进行二次开发的最佳实践
  11. “菁客”发布《2018中国移动社交招聘趋势报告》
  12. 最简单、最详细的装系统教程,你get到了吗?
  13. Long源码与常见问题
  14. python绘制七巧板_CSS3制作七巧板动画
  15. 原生js制作扫雷-自定义难度
  16. 开普互联心系农民 服务三农
  17. 华为备胎除了鸿蒙还有什么,硬件有备胎软件也有!华为鸿蒙操作系统曝光:或可取代安卓Win...
  18. 王喆:深度学习计算广告
  19. 群晖5.2php核心设置_群晖DSM6.0和DSM5.2简单对比
  20. 量化为技艺,策略为根本,相辅相成,运用之妙,存乎一心

热门文章

  1. linux图片裁剪工具,linux中如何使用终端裁剪图片?
  2. [微信小程序]--关于对文章浏览量的实现(inc)
  3. 学编程c语言高考能加分吗,编程已列入中高考,孩子升学加分的机会能否抓住?...
  4. 上dnf一直连接服务器中,Win7系统下玩dnf提示正在连接服务器如何解决
  5. macbook air上安装ubuntu双系统
  6. Windows下etc文件夹
  7. Win键失效,Win+L不起作用了
  8. hourglass论文_Hourglass模块 网络结构 代码
  9. 高盛为什么认为中国AI领域将超越美国?
  10. Directions Reduction -- 5 kyu