西西软件园多重安全检测下载网站、值得信赖的软件下载站!
软件
软件
文章
搜索

首页西西教程Linux → CentOS服务器中安装MySQL数据库

CentOS服务器中安装MySQL数据库

相关软件相关文章发表评论 来源:西西整理时间:2013/8/31 11:35:16字体大小:A-A+

作者:西西点击:29次评论:1次标签: CentOS MySQL数据库

迅雷7v7.9.44.5056 官方最新版
  • 类型:下载工具大小:40.0M语言:中文 评分:9.7
  • 标签:
立即下载

1、首先下载MySQL的安装文件,我这里安装的是MySQL5.1.7版本的,

  下载链接:http://pan.baidu.com/share/link?shareid=255483056&uk=924063144

         http://pan.baidu.com/share/link?shareid=269901909&uk=924063144

2、安装MySQL数据库服务器

  进入安装包所在文件夹,执行命令 rpm -ivh MySQL-server-5.1.7-0.i386.rpm 安装MySQL服务器。

  如果报了与原先版本冲突的话,就执行rpm -qa|grep -i mysql命令,会显示已安装的Mysql版本,我的显示mysql-libs-5.1.61-4.el6.i686
这时如果有的话就强制删除:rpm -e --nodeps mysql-libs-5.1.61-4.el6.i686(因为有包依赖,所以要强制删除)

我的报错提示如下:

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

这时候再执行rpm -ivh MySQL-server-5.1.7-0.i386.rpm安装即可安装成功。
我这里安装成功了,但是mysql服务无法启动,总是启动失败,后来百度了一下,是因为selinux的原因,只要将selinux关闭就OK了。
关闭selinux:vi /etc/selinux/config 将SELINUX=enforcing 改成SELINUX=disabled 然后重启
关闭selinux之后还是无法启动mysql服务,因为安装的mysql所有者是root,在安装mysql的时候会创建一个用户mysql,只要将/var/lib/mysql
的所有者改为mysql就OK了,执行命令chown -R mysql:mysql /var/lib/mysql
现在执行service mysql start终于可以启动mysql服务了。

3.安装MySQL客户端
  执行命令rpm -ivh MySQL-client-5.1.7-0.i386.rpm进行安装。

4.安装成功

  成功安装MySQL后将sql文件导入到数据库,步骤如下:

  进入MYSQL Command Line Client 
  1、先创建数据库:create database test 注:test是创建数据库的名称 
  2、再切换到当前数据库:use test 
  3、再输入:\. /root/test.sql 或 souce /root/test.sql

  按照以上步骤就可以将备份的sql脚本导入到linux中的数据库中去。

    迅雷离线
    (11)迅雷离线
    西西软件园提供好用的迅雷离线下载,开电脑根本下不完,离线的意思是说你关机走了,迅雷那边的服务器还在帮你下载,但不是下到你的电脑上,而是下在他自己的服务器上,等你再上自己电脑的时候就能用非常非常快的速度直接从他的服务器上把那个源下载下来了。迅雷离线下载可以浏览并将自己喜爱的内容保存到离线空间或者移动设备上,您可以使用视频加速功能在线播放或下载到本地播放,离线空间的片源,可以使用云点播功能直接播放,免...更多>>
    bt下载软件
    (21)bt下载软件
    西西软件园提供好用的下载软件免费下载,下载是目前非常流行的一种下载方式,一般我们下载文件或软件,大都由站点或站台下载,若同时间下载人数多时,基于该服务器频宽的因素,速度会减慢许多,而下载软件却恰巧相反,同时间下载的人数越多你下载的速度便越快,因为它采用了多点对多点的传输原理。...更多>>
    迅雷8
    (14)迅雷8
    迅雷.正式版发布,在旧版的基础上,迅雷优化了主界面,增加了一些自定义皮肤。大大增强了下载功能,兼容了更多的下载格式,西西软件园为您提供迅雷.官方下载版本和去除会员限制版本迅雷.改进迅雷.改进了项目管理策略。简单的说,迅雷.中所有的功能改进,都将独立开发测试,只要某项目能够在版本指定的时间段内准备就绪,就能够整合至当前版本发布。若不能将延期至下一版本。这样就避免了迅雷.为了等待某项目解决问题,从而使整体发...更多>>
    下载工具排行
    (282)下载工具排行
    下载工具哪个好呢,下载工具软件排行榜出来了。第一非迅雷莫属,虽然咋雷现在越来越大了,下载速度也不给力了需要会员啦,还有偷偷上传数据。不过相比其他下载工具还是给力些了。只要自己限制迅雷上传速度就可以用了。还有就是现在浏览器都自带有自家的下载工具,速度都很给力了哦。浏览器搜狗浏览器谷歌浏览器都很给力哦。第二送给旋风吧,毕竟用户群太大了,好多朋友喜欢旋风升级的。...更多>>
    迅雷极速版
    (22)迅雷极速版
    迅雷是一款超的下载工具,可以支持所有的协议,包括,,,等。多资源超线程技术还具有互联网下载负载均衡功能,在不降低用户体验的前提下,迅雷网络可以对服务器资源进行均衡,有效降低了服务器负载。世界上最快的下载引擎再一次提速,亿用户的选择,迅雷最懂下载用户,据悉版的开发团队放弃了精简版本,全新开始打造的极速版,不仅优化升级了下载速度,界面布局也进行了全新改版,让用户可以舒心地享受迅雷极速下载体验。此外最大特...更多>>

    相关评论

    阅读本文后您有什么感想? 已有人给出评价!

    • 8 喜欢喜欢
    • 3 顶
    • 1 难过难过
    • 5 囧
    • 3 围观围观
    • 2 无聊无聊

    热门评论

    最新评论

    发表评论 查看所有评论(1)

    昵称:
    表情: 高兴 可 汗 我不要 害羞 好 下下下 送花 屎 亲亲
    字数: 0/500 (您的评论需要经过审核才能显示)