欢迎来到 黑吧安全网 聚焦网络安全前沿资讯,精华内容,交流技术心得!

Mysql安装卸载全过程

来源:本站整理 作者:佚名 时间:2017-08-27 TAG: 我要投稿

Mysql一个熟悉的概念,一个全新的知识领域。开始我全方位数据库学习之旅。
一切,从安装开始,自己动手每一步。

Linux在安装的过程中,可以勾选Mysql的安装,但是安装的版本是Mysql-5.1.73,版本非常低。必须重新安装,当前最新版本是5.7。但是卸载再安装,明显比空白Linux安装麻烦一点。

下面开始卸载/安装过程。

1. Mysql下载地址
https://dev.mysql.com/downloads/file/?id=469494
2. 确认OS版本
# more /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m
# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.7 (Final)
Release:        6.7
Codename:       Final
3. 根据OS版本,找到需要下载的Mysql版本,右键“将链接另存为”,即可获得下载地址
wKiom1lnJfny6OMnAAFkFpwtApI810.png-wh_50
4. 到Linux下,通过wget下载

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.18-1.el6.x86_64.rpm
下面三个rpm包存在依赖关系,也需要下载
# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-common-5.7.18-1.el6.x86_64.rpm
# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm
# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-libs-5.7.18-1.el6.x86_64.rpm
5. 检查查询发现,已经安装Mysql-5.1.73,版本非常低。必须重新安装,当前最新版本是5.7
# rpm -qa | grep mysql
mysql-server-5.1.73-5.el6_6.x86_64
mysql-libs-5.1.73-5.el6_6.x86_64
mysql-5.1.73-5.el6_6.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
6. 准备安装,安装前,就怀疑,会不会覆盖?会不会冲突?安装一下试试,就知道了。
同时安装4个rpm包

# rpm -ivh  mysql-community-server-5.7.18-1.el6.x86_64.rpm mysql-community-client-5.7.18-1.el6.x86_64.rpm  mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm
7. 果然冲突了
warning: mysql-community-server-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
......
8. 经过查询,也安装失败了,还是5.1.73版本
# rpm -qa|grep mysql
mysql-server-5.1.73-5.el6_6.x86_64
mysql-libs-5.1.73-5.el6_6.x86_64
mysql-5.1.73-5.el6_6.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
9. 开始卸载原有的5.1.73的Mysql,几种卸载方式,首推YUM方式卸载
# yum remove mysql
# rpm -e mysql  // 普通删除模式
# rpm -e --nodeps mysql  // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
10 .还剩余下面两个包
# rpm -qa|grep mysql
mysql-libs-5.1.73-5.el6_6.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
11. 执行yum localinstall安装,发现需要卸载mysql-libs-5.1.73-5.el6_6.x86_64,通过yun卸载这个包后,可以安装了。
# yum localinstall mysql-community-server-5.7.18-1.el6.x86_64.rpm mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm  mysql-community-libs-5.7.18-
1.el6.x86_64.rpm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Local Package Process
Examining mysql-community-server-5.7.18-1.el6.x86_64.rpm: mysql-community-server-5.7.18-1.el6.x86_64
Marking mysql-community-server-5.7.18-1.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.cn99.com
* updates: mirrors.163.com
Examining mysql-community-client-5.7.18-1.el6.x86_64.rpm: mysql-community-client-5.7.18-1.el6.x86_64
Marking mysql-community-client-5.7.18-1.el6.x86_64.rpm to be installed
Examining mysql-community-common-5.7.18-1.el6.x86_64.rpm: mysql-community-common-5.7.18-1.el6.x86_64
Marking mysql-community-common-5.7.18-1.el6.x86_64.rpm to be installed

[1] [2] [3] [4]  下一页

【声明】:黑吧安全网(http://www.myhack58.com)登载此文出于传递更多信息之目的,并不代表本站赞同其观点和对其真实性负责,仅适于网络安全技术爱好者学习研究使用,学习中请遵循国家相关法律法规。如有问题请联系我们,联系邮箱admin@myhack58.com,我们会在最短的时间内进行处理。
  • 最新更新
    • 相关阅读
      • 本类热门
        • 最近下载