(六)Linux CenOS6.5 安装mysql

1、首先下载mysql的客户端和服务端  https://dev.mysql.com/downloads/mysql/

2、安装命令     rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm

  此处可能会遇到问题:大概十多个报错

  libc.so.6(GLIBC_2.0)  is needed by MySQL-server-5.1.73-1.glibc23.i386

  libgcc_s.so.1 is needed by MySQL-server-5.1.73-1.glibc23.i386

百度了半天发现了一些信息

这里只摘录关键的几句话:

In Red Hat Enterprise Linux 5, if a package was available for both the main and the compatibility architectures, both architectures of the package were installed by default.In Red Hat Enterprise Linux 6, only the package for the primary architecture is installed by default.To avoid problems during the backup-archive client and API installation on a 64-bit machine, be sure to install libstdc++ and compat-libstdc++.

大意是说,从Red Hat Enterprise Linux 6开始,默认只安装主架构所需要的包,而不安装兼容架构的包,也就是说,64位系统默认只安装64位的软件包。为避免这种问题,在64位系统中,要同时安装64位的包和32位的兼容包。CentOS和从Red Hat Enterprise Linux 6的关系就不用我说了,因此我感觉这个回答比较靠谱,赶紧试试吧。

安装yum install libstdc++.i686          之后发现只剩一个报错

报错:Protected multilib versions: libstdc++-4.4.7-23.el6.i686 != libstdc++-4.4.7-4.el6.x86_64

yum update libstdc++-4.4.7-23.el6.x86_64   将libstdc++-4.4.7-23升级成64位

再安装yum install libstdc++.i686

 

libgcc_s.so.1 is needed by MySQL-server-5.1.73-1.glibc23.i386

下载这个libgcc-4.4.7-18.el6.i686.rpm   

 安装rpm -ivh libgcc-4.4.7-18.el6.i686.rpm 

之后再安装 rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm

没有问题,成功安装

3、安装客户端rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm

又遇到问题 libncursesw.so.5 is needed by MySQL-client-5.1.73-1.glibc23.i386

解决方法:  yum list | grep ncurses   

ncurses.x86_64 5.7-3.20090208.el6 @anaconda-CentOS-201311272149.x86_64/6.5
ncurses-base.x86_64 5.7-3.20090208.el6 @anaconda-CentOS-201311272149.x86_64/6.5
ncurses-libs.x86_64 5.7-3.20090208.el6 @anaconda-CentOS-201311272149.x86_64/6.5
ncurses-devel.i686 5.7-3.20090208.el6 c6-media
ncurses-devel.x86_64 5.7-3.20090208.el6 c6-media
ncurses-libs.i686 5.7-3.20090208.el6 c6-media
ncurses-static.x86_64 5.7-3.20090208.el6 c6-media
ncurses-term.x86_64 5.7-3.20090208.el6 c6-media

安装  yum install ncurses-libs.i686

之后成功安装客户端rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm     

 

 

error: Failed dependencies:
        MySQL conflicts with mysql-5.0.77-4.el5_6.6.x86_64
        MySQL conflicts with mysql-5.0.77-4.el5_6.6.i386

 

后查资料,用rpm -e  confictcompoent -- nodeps解决。如下举例说明:

[root@localhost OMS]# rpm -e mysql-5.0.77-4.el5_6.6.x86_64 --nodeps
[root@localhost OMS]# rpm -e mysql-5.0.77-4.el5_6.6.i386 --nodeps

 

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

[root@localhost ~]# yum list | grep mysql   

yum remove mysql-libs        

 

远程登录mysql

use mysql;把系统默认打开的数据库切换到数据库mysql,出现Database changed时,说明已经成功切换到数据库mysql。

select host,user,password from user;   

update user set password=password("root") where user="root";   root代表你要设置的新密码

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;   

flush privileges;   刷新一下权限就可以了,不用重启 

posted @ 2017-10-31 15:11  淡水留恋  阅读(519)  评论(0编辑  收藏  举报