`
最王座
  • 浏览: 140484 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

RedHat下安装MySQL5.5

阅读更多

MYSQL在windows下面安装可能一帆风顺,但是如果真的到纯图形界面的redhat服务器上,可能就不是那么容易了,这里我就详细的介绍一下MYSQL5.5在linux下的安装以及注意的问题,避免后来人犯错。

工具/原料

   linux - Redhat

   MySQL-5.5.39-2.el6.x86_64.rpm-bundle.tar

   shell控制台

 

方法/步骤

   下载mysql5.5的安装包。这里下载的是MySQL-5.5.39-2.el6.x86_64.rpm-bundle.tar

   解压mysql5.5的安装包

   tar -xvf MySQL-5.5.39-2.el6.x86_64.rpm-bundle.tar

   注意的是要切换的root用户  使用 su root切换用户

   解压之后就是出现了好多的rpm文件

在这些文件中我们要安装的就是下面的3个,这个地方注意了。

MySQL-client-5.5.39-2.el6.x86_64.rpm

MySQL-devel-5.5.39-2.el6.x86_64.rpm

MySQL-server-5.5.39-2.el6.x86_64.rpm

安装过程较快,除了MySQL-server-5.5.39-2.el6.x86_64.rpm稍微慢一些。

其他两个十分的快

使用的命令是

rpm - ivh   *.rpm



这里我们看到安装MySQL-server-5.5.39-2.el6.x86_64.rpm时没有错误,但是如果linux系统默认自带了较低版本的mysql,那么此时就会报错,类似如下错误信息:

Preparing...                ########################################### [100%]
        file /usr/share/mysql/charsets/README from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64
        file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64

        file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.24-1.linux2.6.x86_64 conflicts with file from package mysql-libs-5.1.61-1.el6_2.1.x86_64

原因是系统已经安装了其他版本的mysql-libs包导致不兼容。

删除mysql-libs

[root@localhost ~]# yum remove mysql-libs

执行成功之后,再次安装MySQL-server-5.5.39-2.el6.x86_64.rpm就ok了。

 

接着就是初始化数据库。十分简单 /usr/bin/mysql_install_db

接下来就是查看mysql的状态,并设置mysql的初始密码,见下图。

好了,5步下来我们的mysql就安装完毕。是不是很简单啊。哈哈



但是我们有时候在执行service mysql status时候会提示mysql服务没有启动,那么我们手动启动一下mysql:

service mysql start(停止mysql服务的命令service mysql stop)。

 

至此,rehat下安装mysql5.5已经完毕。

 

  • 大小: 54.5 KB
  • 大小: 66.3 KB
  • 大小: 75.6 KB
  • 大小: 101.2 KB
  • 大小: 50.8 KB
  • 大小: 10.5 KB
  • 大小: 49.5 KB
  • 大小: 18.7 KB
分享到:
评论

相关推荐

    Redhat:安装MySQL5.5

    在Redhat系统上安装MySQL 5.5是一个涉及多个步骤的过程,这包括配置环境、下载安装包、编译源码以及设置数据库参数等。在这个过程中,`my.cnf`文件扮演着至关重要的角色,它是MySQL服务器的主要配置文件,用于定制...

    redhat5.5下MySql数据库的安装配置及简单操作.doc

    以上就是在RHEL5.5环境下安装、配置MySQL数据库的基本步骤和一些基本操作。请注意,实际操作时应根据实际情况调整命令中的路径和参数,以确保安装成功。此外,安全性和性能优化也是数据库管理的重要方面,需要额外...

    mysql5.6-5.5主从备份

    在这个场景中,我们有两台服务器:A服务器作为主服务器运行MySQL 5.6 on Redhat 5.8,而B服务器作为从服务器运行MySQL 5.5 on Windows 10。 ### 主服务器配置 1. **创建同步用户**: 在主服务器上,你需要创建一...

    redhat5.5下MySql数据库的安装配置及简单操作.docx

    redhat5.5下MySql数据库的安装配置及简单操作.docxredhat5.5下MySql数据库的安装配置及简单操作.docx

    redhat5.5下MySql数据库的安装配置及简单操作.pdf

    在Red Hat Enterprise Linux 5.5 (RHEL5.5,简称redhat5.5)系统中安装和配置MySQL数据库涉及一系列步骤。首先,MySQL数据库的安装需要依赖于Perl环境中的两个模块:DBI和DBD-MySQL。下面将详细阐述整个过程。 1. **...

    LINUX环境下MYSQL5.5.X源码安装[借鉴].pdf

    在Linux环境中安装MySQL 5.5.x源代码的过程是一个涉及多步骤的技术任务,适用于软件开发人员和系统管理员。本文将详细解析如何在Linux系统中通过源码安装MySQL 5.5.18版本。 首先,我们需要下载必要的工具和库。在...

    Redhat-Linux-5.5 X86 32位与64位服务器版种子

    这个“Redhat-Linux-5.5 X86 32位与64位服务器版种子”文件很可能是Linux爱好者或系统管理员分享的安装镜像种子,用于下载Red Hat Linux 5.5的ISO镜像。 Red Hat Linux 5.5的核心特性包括: 1. 安全性:Red Hat ...

    Centos 5.5 Nginx+php+mysql成功安装案例

    在CentOS 5.5操作系统中,安装Nginx、PHP和MySQL的组合是一个常见的任务,这个过程可以分为几个关键步骤。以下是一个详细的指南,涵盖了从安装基础环境到配置服务的整个过程。 首先,我们需要确保系统中安装了必要...

    mariadb-5.5.68.tar.gz

    在Linux环境下,通常会使用`tar`命令解压,然后使用`configure`脚本配置编译选项,接着运行`make`和`make install`来构建和安装MariaDB 5.5.68。 总的来说,MariaDB 5.5.68是一个可靠的数据库解决方案,适用于各种...

    CentOS 5.5下安装MySQL 5.5全过程分享

    在本文中,我们将详细探讨如何在CentOS 5.5操作系统上安装MySQL 5.5.27。这个过程涉及到一些必要的预安装步骤,包括卸载已有的MySQL版本,安装必要的编译工具,以及编译和配置MySQL源码。下面我们将逐步进行。 首先...

    redhat 5.5 X86 32、 64位服务器版种子

    这个“redhat 5.5 X86 32、64位服务器版种子”文件包含了这两个版本的安装镜像,使得用户能够在不同的硬件架构上部署Red Hat Enterprise Linux 5.5服务器。 1. **Red Hat Enterprise Linux**:作为Linux操作系统的...

    CentOS 6.2 下升级安装为MySQL 5.5的方法

    以上就是CentOS 6.2环境下从MySQL 5.1升级到5.5的详细步骤。确保在整个过程中密切关注错误信息,及时解决出现的问题,确保数据安全和系统的稳定运行。在升级完成后,务必测试新版本MySQL的功能,以确保一切正常工作...

    linux下安装mysql

    ### Linux 下安装 MySQL 在 Linux 系统中安装 MySQL 数据库是一项常见的任务,尤其是在搭建 Web 服务器时。本文将详细介绍如何在 CentOS 操作系统上安装 MySQL 5.5,并进行必要的配置。 #### 一、安装 cmake 在...

    RedHat Linux 源码安装MYSQL步骤.pdf

    此外,还需要安装`cmake`,因为从MySQL 5.5版本开始,源码编译使用`cmake`而非传统的`configure`脚本。 3. **安装cmake**: 可以从官方网站(http://www.cmake.org/)下载cmake的源码包,然后按照以下步骤进行: ...

    redhat 5.4下安装MYSQL全过程

    在Red Hat Enterprise Linux Server 5.4环境下安装MySQL是一个必要的步骤,特别是对于那些需要Java环境而非预装PHP+Apache组合的用户。在这个过程中,我们首先需要确保系统满足基本的硬件需求,例如文中提到的1核CPU...

    MySQL安全配置详解

    MySQL 可以在 redhat 环境下进行 RPM 安装和 debian 下 apt 安装,但是最新的包一般都是源码的形式,因此这里选择源码编译安装的方式。安装过程中需要注意以下几点: * 登陆官方网站 http://www.mysql.com,下载...

    linux源码、cmake方式安装mysql5.5.28

    在本文中,我们将详细介绍如何通过源码和CMake的方式在Linux环境下安装MySQL 5.5.28。这种方式适用于那些不再支持传统的`./configure`安装方法的新版本MySQL。 #### 1. 查看系统信息 在开始安装之前,首先需要确保...

Global site tag (gtag.js) - Google Analytics