文档章节

CentOS使用yum安装mysql

罗荣熙
 罗荣熙
发布于 2015/05/05 10:56
字数 1505
阅读 405
收藏 0

1、查看CentOS自带mysql是否已安装。 输入命令: [root@localhost ~]# yum list installed | grep mysql 返回信息如下: mysql.x86_64 5.1.73-3.el6_5 @base
mysql-devel.x86_64 5.1.73-3.el6_5 @base
mysql-libs.x86_64 5.1.73-3.el6_5 @base
mysql-server.x86_64 5.1.73-3.el6_5 @base

返回以上信息意思是本机已安装了该版本的mysql

2、若有自带安装的mysql,先卸载CentOS系统自带mysql数据库;若有多个依赖文件则依次卸载。 当结果显示为Complete!即卸载完毕。 输入命令: [root@localhost ~]# yum -y remove mysql.x86_64 返回信息如下: Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be erased --> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-server-5.1.73-3.el6_5.x86_64 --> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-devel-5.1.73-3.el6_5.x86_64 --> Running transaction check ---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be erased ---> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be erased --> Finished Dependency Resolution

Dependencies Resolved

================================================================================ Package Arch Version Repository Size

Removing: mysql x86_64 5.1.73-3.el6_5 @base 2.4 M Removing for dependencies: mysql-devel x86_64 5.1.73-3.el6_5 @base 388 k mysql-server x86_64 5.1.73-3.el6_5 @base 25 M

Transaction Summary

Remove 3 Package(s)

Installed size: 27 M Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Erasing : mysql-devel-5.1.73-3.el6_5.x86_64 1/3 Erasing : mysql-server-5.1.73-3.el6_5.x86_64 2/3 Erasing : mysql-5.1.73-3.el6_5.x86_64 3/3 Verifying : mysql-devel-5.1.73-3.el6_5.x86_64 1/3 Verifying : mysql-server-5.1.73-3.el6_5.x86_64 2/3 Verifying : mysql-5.1.73-3.el6_5.x86_64 3/3

Removed: mysql.x86_64 0:5.1.73-3.el6_5

Dependency Removed: mysql-devel.x86_64 0:5.1.73-3.el6_5 mysql-server.x86_64 0:5.1.73-3.el6_5

Complete!

输入命令: [root@localhost ~]# yum -y remove mysql-libs.x86_64 返回信息如下: Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be erased --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64 --> Running transaction check ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be erased --> Finished Dependency Resolution

Dependencies Resolved

================================================================================ Package Arch Version Repository Size

Removing: mysql-libs x86_64 5.1.73-3.el6_5 @base 4.0 M Removing for dependencies: perl-DBD-MySQL x86_64 4.013-3.el6 @base 338 k

Transaction Summary

Remove 2 Package(s)

Installed size: 4.4 M Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Erasing : perl-DBD-MySQL-4.013-3.el6.x86_64 1/2 Erasing : mysql-libs-5.1.73-3.el6_5.x86_64 2/2 Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/2 Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 2/2

Removed: mysql-libs.x86_64 0:5.1.73-3.el6_5

Dependency Removed: perl-DBD-MySQL.x86_64 0:4.013-3.el6

Complete!

再输入命令: [root@localhost ~]# yum list installed | grep mysql 没有返回信息,即表示已经完成卸载了。

3、查看yum库上的mysql版本信息(CentOS系统需要正常连接网络)。 输入命令: [root@localhost ~]# yum -y list mysql* 返回信息如下: Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile

  • base: mirrors.zju.edu.cn
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com Available Packages MySQL-python.x86_64 1.2.3-0.3.c1.1.el6 base mysql.x86_64 5.1.73-3.el6_5 base mysql-bench.x86_64 5.1.73-3.el6_5 base mysql-connector-java.noarch 1:5.1.17-6.el6 base mysql-connector-odbc.x86_64 5.1.5r1144-7.el6 base mysql-devel.i686 5.1.73-3.el6_5 base mysql-devel.x86_64 5.1.73-3.el6_5 base mysql-embedded.i686 5.1.73-3.el6_5 base mysql-embedded.x86_64 5.1.73-3.el6_5 base mysql-embedded-devel.i686 5.1.73-3.el6_5 base mysql-embedded-devel.x86_64 5.1.73-3.el6_5 base mysql-libs.i686 5.1.73-3.el6_5 base mysql-libs.x86_64 5.1.73-3.el6_5 base mysql-server.x86_64 5.1.73-3.el6_5 base mysql-test.x86_64 5.1.73-3.el6_5 base

4、使用yum安装mysql数据库。 输入:yum -y install mysql-server mysql mysql-devel ,命令将:mysql-server、mysql、mysql-devel都安装好,当结果显示为“Complete!”即安装完毕。 注:安装mysql只是安装了数据库,只有安装mysql-server才相当于安装了客户端。

输入命令: [root@localhost ~]# yum -y install mysql-server mysql mysql-devel 返回信息如下: Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile

  • base: mirrors.zju.edu.cn
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be installed --> Processing Dependency: mysql-libs = 5.1.73-3.el6_5 for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 ---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be installed ---> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be installed --> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-3.el6_5.x86_64 --> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be installed ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed --> Finished Dependency Resolution

Dependencies Resolved

================================================================================ Package Arch Version Repository Size

Installing: mysql x86_64 5.1.73-3.el6_5 base 894 k mysql-devel x86_64 5.1.73-3.el6_5 base 129 k mysql-server x86_64 5.1.73-3.el6_5 base 8.6 M Installing for dependencies: mysql-libs x86_64 5.1.73-3.el6_5 base 1.2 M perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k

Transaction Summary

Install 5 Package(s)

Total download size: 11 M Installed size: 32 M Downloading Packages: (1/5): mysql-5.1.73-3.el6_5.x86_64.rpm | 894 kB 00:04
(2/5): mysql-devel-5.1.73-3.el6_5.x86_64.rpm | 129 kB 00:00
(3/5): mysql-libs-5.1.73-3.el6_5.x86_64.rpm | 1.2 MB 00:07
(4/5): mysql-server-5.1.73-3.el6_5.x86_64.rpm | 8.6 MB 01:04
(5/5): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm | 134 kB 00:00

Total 144 kB/s | 11 MB 01:18
Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-libs-5.1.73-3.el6_5.x86_64 1/5 Installing : mysql-5.1.73-3.el6_5.x86_64 2/5 Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 3/5 Installing : mysql-server-5.1.73-3.el6_5.x86_64 4/5 Installing : mysql-devel-5.1.73-3.el6_5.x86_64 5/5 Verifying : mysql-devel-5.1.73-3.el6_5.x86_64 1/5 Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 2/5 Verifying : mysql-server-5.1.73-3.el6_5.x86_64 3/5 Verifying : mysql-5.1.73-3.el6_5.x86_64 4/5 Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 5/5

Installed: mysql.x86_64 0:5.1.73-3.el6_5 mysql-devel.x86_64 0:5.1.73-3.el6_5
mysql-server.x86_64 0:5.1.73-3.el6_5

Dependency Installed: mysql-libs.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6

Complete!

5、查看刚安装mysql数据库版本信息。 输入命令: [root@localhost ~]# rpm -qi mysql-server 返回信息如下: Name : mysql-server Relocations: (not relocatable) Version : 5.1.73 Vendor: CentOS Release : 3.el6_5 Build Date: Thu 13 Feb 2014 03:42:39 AM CST Install Date: Tue 05 May 2015 10:06:02 AM CST Build Host: c6b9.bsys.dev.centos.org Group : Applications/Databases Source RPM: mysql-5.1.73-3.el6_5.src.rpm Size : 25882723 License: GPLv2 with exceptions Signature : RSA/SHA1, Thu 13 Feb 2014 03:48:08 AM CST, Key ID 0946fca2c105b9de Packager : CentOS BuildSystem http://bugs.centos.org URL : http://www.mysql.com Summary : The MySQL server and related files Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries. This package contains the MySQL server and some accompanying files and directories.

© 著作权归作者所有

共有 人打赏支持
罗荣熙
粉丝 26
博文 118
码字总数 84709
作品 0
广州
程序员
私信 提问
CentOS使用yum安装mysql(超简单)

工具/原料 yum库 Mysql数据库 CentOS6.4_64bit 方法/步骤 1 查看CentOS自带mysql是否已安装。 输入:yum list installed | grep mysql 2/5 若有自带安装的mysql,如何卸载CentOS系统自带mys...

bengozhong
2016/10/17
2
0
centos softs install recored

安装非常简单,如是其他版本linux系统,使用相应的在线升级命令即可,如apt-get 1.安装中文包:yum -y groupinstall chinese-support 2.修改字符编码配置文件 vi /etc/sysconfig/i18n LANGU...

daniel-john
2014/07/02
0
0
yum安装最新的mysql

通常在使用Yum安装MySQL时,centos6默认安装的是伴随OS发布的旧MySQL版本,centos7安装的MariaDB。之前要安装最新的MySQL版本,你必须去Oracle的MySQL主页,下载最新的发布版本,然后编译安装...

hiwill
2015/09/09
459
0
CentOS 6.2 使用第三方yum源安装更多rpm软件包

引言: CentOS自带的yum源中rpm包数量有限,很多时候找不到我们需的软件包,(例如:要安装网络连接查看软件iftop,默认设置下无法使用yum命令安装),下面教大家在CentOS 6.2中(以32位系统...

jackjie2010
2012/04/02
0
0
使用第三方yum源安装更多rpm软件包

引言: CentOS自带的yum源中rpm包数量有限,很多时候找不到我们需的软件包,(例如:要安装网络连接查看软件iftop,默认设置下无法使用yum命令安装),下面教大家在CentOS 6.2中(以32位系统...

cnu2m
2013/12/25
0
0

没有更多内容

加载失败,请刷新页面

加载更多

支付宝api实现转账到单个账号

项目后台需要实现用户提现功能,支付宝平台对应的就是“单笔转账到支付宝账户”。具体实现见代码,无套路! 肯定需要先申请支付宝商户账号相关信息。以下为个人沙箱环境实现代码,生产上只需...

貔貅叔
15分钟前
1
0
Spark自定义维护kafka的offset到zk

import kafka.common.TopicAndPartitionimport kafka.message.MessageAndMetadataimport kafka.serializer.StringDecoderimport kafka.utils.ZkUtilsimport org.I0Itec.zkclient.ZkC......

hblt-j
15分钟前
0
0
bash运行脚本的几种方式

bash shell 脚本执行的方法有多种,本文作一个总结,供大家学习参考。 假设我们编写好的shell脚本的文件名为hello.sh,文件位置在/data/shell目录中并已有执行权限。 方法一:切换到shell脚本...

吴伟祥
25分钟前
0
0
看图了解RocksDB

摘要: 它是一个高性能的Key-Value数据库。设计了完善的持久化机制,同时保证性能和安全性。能够良好的支持范围查询,因为K-V记录就是按照Key来排序的。 下图为写入的流程: 可以看到主要的三...

阿里云官方博客
34分钟前
0
0
关于Python pandas模块输出每行中间省略号问题

关于Python数据分析中pandas模块在输出的时候,每行的中间会有省略号出现,和行与行中间的省略号....问题,其他的站点(百度)中的大部分都是瞎写,根本就是复制黏贴以前的版本,你要想知道其...

上官夏洛特
35分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部