1:也许之前的机器安装过Mysql,但是自己不知道,账号密码也忘记了,又执行安装操作,导致Mysql不兼容问题。Linux上安装MySQL时出现不兼容的解决办法,错误如下所示:
1 [root@master package]# rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm 2 Preparing... ########################################### [100%] 3 file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 4 file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 5 file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 6 file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 7 file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 8 file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 9 file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 10 file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 11 file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 12 file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 13 file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 14 file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 15 file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 16 file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 17 file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 18 file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 19 file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 20 file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 21 file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 22 file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 23 file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 24 file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 25 file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 26 file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 27 file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 28 file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 29 file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 30 file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 31 file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 32 file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 33 file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 34 file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 35 file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 36 file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 37 file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 38 file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 39 file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 40 file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 41 file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 42 file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 43 file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 44 file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 45 file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 46 file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 47 file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 48 file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 49 file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 50 file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686 51 file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686
2:出现问题了,就解决呗,原因是系统已经安装了其他版本的mysql-libs包导致不兼容。
可以使用命令查看yum list | grep mysql,查看之前安装的mysql的信息,如下所示:
1 [root@master package]# yum list | grep mysql 2 Repository c6-media is listed more than once in the configuration 3 mysql-libs.i686 5.1.73-8.el6_8 @base 4 apr-util-mysql.i686 1.3.9-3.el6_0.1 base 5 bacula-director-mysql.i686 5.0.0-13.el6 base 6 bacula-storage-mysql.i686 5.0.0-13.el6 base 7 dovecot-mysql.i686 1:2.0.9-22.el6 base 8 freeradius-mysql.i686 2.2.6-7.el6_9 updates 9 libdbi-dbd-mysql.i686 0.8.3-5.1.el6 base 10 mod_auth_mysql.i686 1:3.0.0-11.el6_0.1 base 11 mysql.i686 5.1.73-8.el6_8 base 12 mysql-bench.i686 5.1.73-8.el6_8 base 13 mysql-connector-java.noarch 1:5.1.17-6.el6 base 14 mysql-connector-odbc.i686 5.1.5r1144-7.el6 base 15 mysql-devel.i686 5.1.73-8.el6_8 base 16 mysql-embedded.i686 5.1.73-8.el6_8 base 17 mysql-embedded-devel.i686 5.1.73-8.el6_8 base 18 mysql-server.i686 5.1.73-8.el6_8 base 19 mysql-test.i686 5.1.73-8.el6_8 base 20 pcp-pmda-mysql.i686 3.10.9-9.el6 base 21 php-mysql.i686 5.3.3-49.el6 base 22 qt-mysql.i686 1:4.6.2-28.el6_5 base 23 rsyslog-mysql.i686 5.8.10-10.el6_6 base 24 rsyslog7-mysql.i686 7.4.10-7.el6 base
3:将之前的mysql的lib包删除了即可,删除mysql-libs:
1 [root@master package]# yum remove mysql-libs 2 Loaded plugins: fastestmirror, refresh-packagekit, security 3 Setting up Remove Process 4 Resolving Dependencies 5 --> Running transaction check 6 ---> Package mysql-libs.i686 0:5.1.73-8.el6_8 will be erased 7 --> Processing Dependency: libmysqlclient.so.16 for package: 2:postfix-2.6.6-8.el6.i686 8 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: 2:postfix-2.6.6-8.el6.i686 9 --> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-8.el6.i686 10 --> Running transaction check 11 ---> Package postfix.i686 2:2.6.6-8.el6 will be erased 12 --> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-16.el6_8.2.i686 13 --> Running transaction check 14 ---> Package cronie.i686 0:1.4.4-16.el6_8.2 will be erased 15 --> Processing Dependency: cronie = 1.4.4-16.el6_8.2 for package: cronie-anacron-1.4.4-16.el6_8.2.i686 16 --> Running transaction check 17 ---> Package cronie-anacron.i686 0:1.4.4-16.el6_8.2 will be erased 18 --> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch 19 --> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-33.el6.i686 20 --> Restarting Dependency Resolution with new changes. 21 --> Running transaction check 22 ---> Package crontabs.noarch 0:1.10-33.el6 will be erased 23 ---> Package sysstat.i686 0:9.0.4-33.el6 will be erased 24 --> Finished Dependency Resolution 25 26 Dependencies Resolved 27 28 =============================================================================================================================================================================================== 29 Package Arch Version Repository Size 30 =============================================================================================================================================================================================== 31 Removing: 32 mysql-libs i686 5.1.73-8.el6_8 @base 3.9 M 33 Removing for dependencies: 34 cronie i686 1.4.4-16.el6_8.2 @base 169 k 35 cronie-anacron i686 1.4.4-16.el6_8.2 @base 38 k 36 crontabs noarch 1.10-33.el6 @anaconda-CentOS-201303020136.i386/6.4 2.4 k 37 postfix i686 2:2.6.6-8.el6 @base 9.4 M 38 sysstat i686 9.0.4-33.el6 @base 804 k 39 40 Transaction Summary 41 =============================================================================================================================================================================================== 42 Remove 6 Package(s) 43 44 Installed size: 14 M 45 Is this ok [y/N]: y 46 Downloading Packages: 47 Running rpm_check_debug 48 Running Transaction Test 49 Transaction Test Succeeded 50 Running Transaction 51 Repository c6-media is listed more than once in the configuration 52 Erasing : sysstat-9.0.4-33.el6.i686 1/6 53 Erasing : cronie-anacron-1.4.4-16.el6_8.2.i686 2/6 54 Erasing : crontabs-1.10-33.el6.noarch 3/6 55 Erasing : cronie-1.4.4-16.el6_8.2.i686 4/6 56 Erasing : 2:postfix-2.6.6-8.el6.i686 5/6 57 Erasing : mysql-libs-5.1.73-8.el6_8.i686 6/6 58 warning: erase unlink of /usr/share/mysql/ukrainian/errmsg.sys failed: No such file or directory 59 warning: erase unlink of /usr/share/mysql/ukrainian failed: No such file or directory 60 warning: erase unlink of /usr/share/mysql/swedish/errmsg.sys failed: No such file or directory 61 warning: erase unlink of /usr/share/mysql/swedish failed: No such file or directory 62 warning: erase unlink of /usr/share/mysql/spanish/errmsg.sys failed: No such file or directory 63 warning: erase unlink of /usr/share/mysql/spanish failed: No such file or directory 64 warning: erase unlink of /usr/share/mysql/slovak/errmsg.sys failed: No such file or directory 65 warning: erase unlink of /usr/share/mysql/slovak failed: No such file or directory 66 warning: erase unlink of /usr/share/mysql/serbian/errmsg.sys failed: No such file or directory 67 warning: erase unlink of /usr/share/mysql/serbian failed: No such file or directory 68 warning: erase unlink of /usr/share/mysql/russian/errmsg.sys failed: No such file or directory 69 warning: erase unlink of /usr/share/mysql/russian failed: No such file or directory 70 warning: erase unlink of /usr/share/mysql/romanian/errmsg.sys failed: No such file or directory 71 warning: erase unlink of /usr/share/mysql/romanian failed: No such file or directory 72 warning: erase unlink of /usr/share/mysql/portuguese/errmsg.sys failed: No such file or directory 73 warning: erase unlink of /usr/share/mysql/portuguese failed: No such file or directory 74 warning: erase unlink of /usr/share/mysql/polish/errmsg.sys failed: No such file or directory 75 warning: erase unlink of /usr/share/mysql/polish failed: No such file or directory 76 warning: erase unlink of /usr/share/mysql/norwegian/errmsg.sys failed: No such file or directory 77 warning: erase unlink of /usr/share/mysql/norwegian-ny/errmsg.sys failed: No such file or directory 78 warning: erase unlink of /usr/share/mysql/norwegian-ny failed: No such file or directory 79 warning: erase unlink of /usr/share/mysql/norwegian failed: No such file or directory 80 warning: erase unlink of /usr/share/mysql/korean/errmsg.sys failed: No such file or directory 81 warning: erase unlink of /usr/share/mysql/korean failed: No such file or directory 82 warning: erase unlink of /usr/share/mysql/japanese/errmsg.sys failed: No such file or directory 83 warning: erase unlink of /usr/share/mysql/japanese failed: No such file or directory 84 warning: erase unlink of /usr/share/mysql/italian/errmsg.sys failed: No such file or directory 85 warning: erase unlink of /usr/share/mysql/italian failed: No such file or directory 86 warning: erase unlink of /usr/share/mysql/hungarian/errmsg.sys failed: No such file or directory 87 warning: erase unlink of /usr/share/mysql/hungarian failed: No such file or directory 88 warning: erase unlink of /usr/share/mysql/greek/errmsg.sys failed: No such file or directory 89 warning: erase unlink of /usr/share/mysql/greek failed: No such file or directory 90 warning: erase unlink of /usr/share/mysql/german/errmsg.sys failed: No such file or directory 91 warning: erase unlink of /usr/share/mysql/german failed: No such file or directory 92 warning: erase unlink of /usr/share/mysql/french/errmsg.sys failed: No such file or directory 93 warning: erase unlink of /usr/share/mysql/french failed: No such file or directory 94 warning: erase unlink of /usr/share/mysql/estonian/errmsg.sys failed: No such file or directory 95 warning: erase unlink of /usr/share/mysql/estonian failed: No such file or directory 96 warning: erase unlink of /usr/share/mysql/english/errmsg.sys failed: No such file or directory 97 warning: erase unlink of /usr/share/mysql/english failed: No such file or directory 98 warning: erase unlink of /usr/share/mysql/dutch/errmsg.sys failed: No such file or directory 99 warning: erase unlink of /usr/share/mysql/dutch failed: No such file or directory 100 warning: erase unlink of /usr/share/mysql/danish/errmsg.sys failed: No such file or directory 101 warning: erase unlink of /usr/share/mysql/danish failed: No such file or directory 102 warning: erase unlink of /usr/share/mysql/czech/errmsg.sys failed: No such file or directory 103 warning: erase unlink of /usr/share/mysql/czech failed: No such file or directory 104 warning: erase unlink of /usr/share/mysql/charsets/swe7.xml failed: No such file or directory 105 warning: erase unlink of /usr/share/mysql/charsets/macroman.xml failed: No such file or directory 106 warning: erase unlink of /usr/share/mysql/charsets/macce.xml failed: No such file or directory 107 warning: erase unlink of /usr/share/mysql/charsets/latin7.xml failed: No such file or directory 108 warning: erase unlink of /usr/share/mysql/charsets/latin5.xml failed: No such file or directory 109 warning: erase unlink of /usr/share/mysql/charsets/latin2.xml failed: No such file or directory 110 warning: erase unlink of /usr/share/mysql/charsets/latin1.xml failed: No such file or directory 111 warning: erase unlink of /usr/share/mysql/charsets/koi8u.xml failed: No such file or directory 112 warning: erase unlink of /usr/share/mysql/charsets/koi8r.xml failed: No such file or directory 113 warning: erase unlink of /usr/share/mysql/charsets/keybcs2.xml failed: No such file or directory 114 warning: erase unlink of /usr/share/mysql/charsets/hp8.xml failed: No such file or directory 115 warning: erase unlink of /usr/share/mysql/charsets/hebrew.xml failed: No such file or directory 116 warning: erase unlink of /usr/share/mysql/charsets/greek.xml failed: No such file or directory 117 warning: erase unlink of /usr/share/mysql/charsets/geostd8.xml failed: No such file or directory 118 warning: erase unlink of /usr/share/mysql/charsets/dec8.xml failed: No such file or directory 119 warning: erase unlink of /usr/share/mysql/charsets/cp866.xml failed: No such file or directory 120 warning: erase unlink of /usr/share/mysql/charsets/cp852.xml failed: No such file or directory 121 warning: erase unlink of /usr/share/mysql/charsets/cp850.xml failed: No such file or directory 122 warning: erase unlink of /usr/share/mysql/charsets/cp1257.xml failed: No such file or directory 123 warning: erase unlink of /usr/share/mysql/charsets/cp1256.xml failed: No such file or directory 124 warning: erase unlink of /usr/share/mysql/charsets/cp1251.xml failed: No such file or directory 125 warning: erase unlink of /usr/share/mysql/charsets/cp1250.xml failed: No such file or directory 126 warning: erase unlink of /usr/share/mysql/charsets/ascii.xml failed: No such file or directory 127 warning: erase unlink of /usr/share/mysql/charsets/armscii8.xml failed: No such file or directory 128 warning: erase unlink of /usr/share/mysql/charsets/README failed: No such file or directory 129 warning: erase unlink of /usr/share/mysql/charsets/Index.xml failed: No such file or directory 130 warning: erase unlink of /usr/share/mysql/charsets failed: No such file or directory 131 warning: erase unlink of /usr/share/mysql failed: No such file or directory 132 warning: erase unlink of /usr/lib/mysql/libmysqlclient_r.so.16.0.0 failed: No such file or directory 133 warning: erase unlink of /usr/lib/mysql/libmysqlclient_r.so.16 failed: No such file or directory 134 warning: erase unlink of /usr/lib/mysql/libmysqlclient.so.16.0.0 failed: No such file or directory 135 warning: erase unlink of /usr/lib/mysql/libmysqlclient.so.16 failed: No such file or directory 136 warning: erase unlink of /usr/lib/mysql failed: No such file or directory 137 Verifying : crontabs-1.10-33.el6.noarch 1/6 138 Verifying : sysstat-9.0.4-33.el6.i686 2/6 139 Verifying : mysql-libs-5.1.73-8.el6_8.i686 3/6 140 Verifying : cronie-1.4.4-16.el6_8.2.i686 4/6 141 Verifying : cronie-anacron-1.4.4-16.el6_8.2.i686 5/6 142 Verifying : 2:postfix-2.6.6-8.el6.i686 6/6 143 144 Removed: 145 mysql-libs.i686 0:5.1.73-8.el6_8 146 147 Dependency Removed: 148 cronie.i686 0:1.4.4-16.el6_8.2 cronie-anacron.i686 0:1.4.4-16.el6_8.2 crontabs.noarch 0:1.10-33.el6 postfix.i686 2:2.6.6-8.el6 sysstat.i686 0:9.0.4-33.el6 149 150 Complete! 151 [root@master package]#
4:然后开始安装你的mysql,在linux操作系统上面:http://www.cnblogs.com/biehongli/p/7693598.html
5:以上方法,亲测可以,下面是更暴力卸载的,看着好像方便些,未测:https://www.cnblogs.com/angelasp/p/4301446.html
停更......
2017-12-09 23:43:43