前期准备工作:
首先在http://www.mysql.com/downloads/mysql/里面下载两个文件,
(1)MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm
(2)MySQL-client-5.6.10-1.linux_glibc2.5.x86_64.rpm
先来说下rpm这个格式:
rpm文件是Red Hat公司开发的软件安装包,rpm可让Linux在安装软件包时免除许多复杂的手续。该命令在安装时常用的参数是 –ivh ,其中i表示将安装指定的rmp软件包,V表示安装时的详细信息,h表示在安装期间出现“#”符号来显示目前的安装过程。这个符号将持续到安装完成后才停 止。
完后进入到自己的虚拟机操作,这里提下Vmware tool这个安装了以后可以在虚拟机和主机之间直接复制粘贴文件,很好用。
下面是在虚拟机上的操作:
[root @localhost root]# cd /anzhuang
[root @localhost anzhuang]# ls -al
总用量 108376
drwxr-xr-x 2 root root 4096 4月 12 16:58 .
drwxr-xr-x 23 root root 4096 4月 12 16:57 ..
-rw-r--r-- 1 root root 22970964 4月 12 16:58 MySQL-client-5.6.10-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 root root 87875484 4月 12 16:58 MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm
[root @localhost anzhuang]# rpm -ivh MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm
warning: MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
error: Failed dependencies:
libc.so.6(GLIBC_2.3.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5 libc.so.6(GLIBC_2.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6 is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6(CXXABI_1.3) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6(GLIBCXX_3.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
rtld(GNU_HASH) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
mysql conflicts with MySQL-server-5.6.10-1.linux_glibc2.5
mysql-server conflicts with MySQL-server-5.6.10-1.linux_glibc2.5
运行后发现报错了,网上查了下,估计是以前自带了mysql,已经安装好了的。
查看了下确实发现里面有
[root @localhost anzhuang]# rpm -qa |grep -i mysql
mysql-devel-3.23.54a-11
perl-DBD-MySQL-2.1021-3
php-mysql-4.2.2-17
libdbi-dbd-mysql-0.6.5-5
mysql-server-3.23.54a-11
mysql-3.23.54a-11
MySQL-python-0.9.1-6
qt-MySQL-3.1.1-6
mod_auth_mysql-1.11-12
里面出现了
mysql-server-3.23.54a-11
说明存在的
所以先删除
[root @localhost anzhuang]# rpm -ev mysql-server-3.23.54a-11
后面发现还是不行,又查资料,发现可以在后面加两个参数--nodeps --force
[root@localhost anzhuang]# rpm -ivh MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm
warning: MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
error: Failed dependencies:
libc.so.6(GLIBC_2.3.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5 libc.so.6(GLIBC_2.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6 is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6(CXXABI_1.3) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
libstdc++.so.6(GLIBCXX_3.4) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
rtld(GNU_HASH) is needed by MySQL-server-5.6.10-1.linux_glibc2.5
mysql conflicts with MySQL-server-5.6.10-1.linux_glibc2.5
[root@localhost anzhuang]# rpm -ivh MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm -nodeps --force
-nodeps: unknown option
[root@localhost anzhuang]# rpm -ivh MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm --nodeps --force
warning: MySQL-server-5.6.10-1.linux_glibc2.5.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing... ########################################### [100%]
You have more than one PID file:
ls: /var/lib/mysql/*.pid: 没有那个文件或目录
Please check which one (if any) corresponds to a running server
and delete all others before repeating the MySQL upgrade.
error: %pre(MySQL-server-5.6.10-1.linux_glibc2.5) scriptlet failed, exit status
1
error: install: %pre scriptlet failed (2), skipping MySQL-server-5.6.10-1.linux_glibc2.5
加上那两个参数的意义就在于,
安装时不再分析包之间的依赖关系而直接安装,
也就不会再提示error: Failed dependencies:这样的错误了。
OK 先到这里,可能自己理解的不正确,后面继续学习哈哈。