简体   繁体   中英

Can't install MySQL 5.6 by RPM

I'm trying to install MySQL 5.6 community edition from the RPM package I downloaded. I'm running on cloudera's CDH 4.5 virtual machine, which is CentOS 6.4. The VM came with MySQL 5.1.73 installed, the old versions of files seem to be blocking me from updating.

I already did this:

sudo yum remove mysql

and that worked just fine, without a problem. Then I deleted everything in /usr/lib/mysql, aka the data directory. So then I tried installing the new version:

[cloudera@localhost mysql]$ pwd
/home/cloudera/mysql
[cloudera@localhost mysql]$ ll
total 302660
-rw-r--r-- 1 cloudera cloudera  23080383 Mar 17 02:39 MySQL-client-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera   4573735 Mar 17 02:40 MySQL-devel-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 114192347 Mar 17 02:40 MySQL-embedded-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera  86961692 Mar 17 02:41 MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera   2398671 Mar 17 02:41 MySQL-shared-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera   5180653 Mar 17 02:41 MySQL-shared-compat-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera  73530987 Mar 17 02:42 MySQL-test-5.6.17-1.linux_glibc2.5.x86_64.rpm
[cloudera@localhost mysql]$ sudo yum install MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
.....
Downloading Packages:
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.17-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
  file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.17-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
......

So it looks like the old installation is blocking me, I tried to delete mysql-libs but...

[cloudera@localhost mysql]$ sudo yum remove mysql-libs
.....
 pig                                                noarch                  0.11.0+33-1.cdh4.4.0.p0.14.el6                   @cloudera-cdh4                                            120 M
 postfix                                            x86_64                  2:2.6.6-2.2.el6_1                                @anaconda-CentOS-201112091719.x86_64/6.2                  9.7 M
 redhat-lsb                                         x86_64                  4.0-7.el6.centos                                 @base                                                     0.0  
 redhat-lsb-compat                                  x86_64                  4.0-7.el6.centos                                 @base                                                     0.0  
 redhat-lsb-core                                    x86_64                  4.0-7.el6.centos                                 @base                                                      22 k
 redhat-lsb-graphics                                x86_64                  4.0-7.el6.centos                                 @base                                                     0.0  
 redhat-lsb-printing                                x86_64                  4.0-7.el6.centos                                 @base                                                     0.0  
 solr                                               noarch                  4.4.0+69-1.cdh4.3.0.p0.4.el6                     @cloudera-search                                           66 M
 solr-mapreduce                                     noarch                  1.0.0-1.cdh4.3.0.p0.5.el6                        @cloudera-search                                           55 M
 sqoop                                              noarch                  1.4.3+62-1.cdh4.4.0.p0.15.el6                    @cloudera-cdh4                                            7.7 M
 sqoop2                                             noarch                  1.99.2+85-1.cdh4.4.0.p0.62.el6                   @cloudera-cdh4                                            7.8 M
 sysstat                                            x86_64                  9.0.4-20.el6                                     @base                                                     807 k
 tomcat                                             noarch                  7.0.33-3.el6                                     @epel                                                     303 k

Transaction Summary
=============================================================================================================================================================================================
Remove       67 Package(s)

It went and listed a lot of major software that depends on mysql-libs. I don't want to reinstall tomcat, pig, hive, mahout, hue, oozie, flume, and cloudera manager. I have worked with those before, I know that they are a NIGHTMARE to get installed and configured correctly, so I really don't want to uninstall those.

So I thought maybe I should try an update instead,

[cloudera@localhost mysql]$ sudo yum update MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
....
Examining MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm: MySQL-server-5.6.17-1.linux_glibc2.5.x86_64
Package MySQL-server not installed, cannot update it. Run yum install to install it instead.
No Packages marked for Update

It will not let me update it because I already removed it.

Would somebody please tell me how to install MySQL from these RPMs without uninstalling everything else?

尝试安装shared-compat包,你可以看到在这里

I'm just going to re-write the answer for anybody else who comes across this.

  1. Download the mysql yum repo if you don't already have it: http://dev.mysql.com/downloads/file.php?id=450542
  2. If you have an old version of mysql installed, just do a yum update mysql. You may also need to do yum update mysql-server.
  3. If you uninstalled it, try to reinstall now that you have the new yum repo. If it still fails due to a Transaction check error, try deleting any files that it lists in conflict. Be careful not to delete any files you want to keep.
  4. you may also need to do 'sudo yum update mysql-server' or 'sudo yum install mysql-server'. I did.

I will mark acfrai's answer correct to give him credit, he helped lead me to this information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM