日期:2014-05-16 浏览次数:20682 次
Linux下卸载MySQL 1、查找以前是否装有MySQL 命令:rpm -qa|grep -i MySQL 可以看到MySQL的两个包: MySQL-4.1.12-3.RHEL4.1 MySQLclient10-3.23.58-4.RHEL4.1 2、删除MySQL 删除命令:rpm -e --nodeps 包名 ( rpm -ev MySQL-4.1.12-3.RHEL4.1 ) 3、删除老版本MySQL的开发头文件和库 命令:rm -fr /usr/lib/MySQL rm -fr /usr/include/MySQL 注意:卸载后/var/lib/MySQL中的数据及/etc/my.cnf不会删除,如果确定没用后就手工删除 rm -f /etc/my.cnf rm -fr /var/lib/MySQL 安装MySQL 安装前准备:两个rpm包 MySQL-client-5.1.20-0.glibc23.i386.rpm MySQL-server-5.1.20-0.glibc23.i386.rpm 1、安装服务端: 命令:rpm -ivh MySQL-server-5.1.20-0.glibc23.i386.rpm 安装成功会出现.... warning: MySQL-server-5.1.20-0.glibc23.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Preparing... ########################################### [100%] 1:MySQL-server ########################################### [100%] 080220 13:58:27 [Note] Plugin 'InnoDB' disabled by command line option 080220 13:58:28 [Note] Plugin 'InnoDB' disabled by command line option PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: