本文详细介绍在CentOS 6.4下安装MySQL 5.6.22的过程,供需要的朋友学习参考。

本文详细介绍在CentOS 6.4下安装MySQL 5.6.22的过程,供需要的朋友学习参考。

一、下载MySQL 安装包

1) 打开网址: Select Platform: 选择 Linux-Generic

选择选择 Linux - Generic (glibc 2.5) (x86, 64-bit), RPM 进行下载;

linux 下下载: wget

2)下载完后解压缩并放到安装文件夹下:

tar -xf MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar

mv MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle /usr/local/software/

mv MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle mysql

其中里面要使用的是这两个:

MySQL数据库: MySQL-server-5.6.22-1.linux_glibc2.5.x86_64.rpm

MySQL客户端:MySQL-client-5.6.22-1.linux_glibc2.5.x86_64.rpm

3)安装环境:cat /etc/RedHat-release

CentOS release 6.4 (Final)

二、MySql安装

1)3)检查安装

在安装MySQL之前,先检查CentOS系统中是否已经安装了一个MySQL,如果已经安装先卸载,不然会导致安装新的MySQL失败。

rpm -qa | grep mysql --查看系统之前是否已安装MySQL。

mysql-libs-5.1.47-4.el6.i686 显示结果说明 CentOS6.0系统自带了一个MySQL,我们需要删除这个老版本,用root用户执行下面语句

su -

密码:

rpm -e --nodeps mysql-libs-5.1.47-4.el6.i686

先切换到"root"用户下,然后执行删除语句,删除之后,我们再次查看,发现已经成功删除了CentOS6.0自带的旧MySQL版本。

在删除MySQL的rpm后,还要进行一些扫尾操作,网上有两种操作。(备注:我在这里两种都没有用到,发现系统中并没有其他残余的MySQL信息。)

第一种善后处理:使用下面命令进行处理。

rm -rf /var/lib/mysql*

rm -rf /usr/share/mysql*

另一种善后处理:卸载后 /var/lib/mysql 中的 /etc/my.cnf 会重命名为 my.cnf.rpmsave,/var/log/mysqld.log 会重命名为 /var/log/mysqld.log.rpmsave,如果确定没用后就手工删除。

2)安装MySql 服务端

rpm -ivh MySQL-server-5.6.22-1.linux_glibc2.5.x86_64.rpm

Preparing... ########################################### [100%]

1:MySQL-server ########################################### [100%]

warning: user mysql does not exist - using root

warning: group mysql does not exist - using root

2014-08-10 22:43:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-08-10 22:43:44 23012 [Note] InnoDB: Using atomics to ref count buffer pool pages

2014-08-10 22:43:44 23012 [Note] InnoDB: The InnoDB memory heap is disabled

2014-08-10 22:43:44 23012 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2014-08-10 22:43:44 23012 [Note] InnoDB: Memory barrier is not used

2014-08-10 22:43:44 23012 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-08-10 22:43:44 23012 [Note] InnoDB: Using Linux native AIO

2014-08-10 22:43:44 23012 [Note] InnoDB: Not using CPU crc32 instructions

2014-08-10 22:43:44 23012 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-08-10 22:43:44 23012 [Note] InnoDB: Completed initialization of buffer pool

2014-08-10 22:43:45 23012 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2014-08-10 22:43:45 23012 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2014-08-10 22:43:45 23012 [Note] InnoDB: Database physically writes the file full: wait...

2014-08-10 22:43:45 23012 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2014-08-10 22:43:46 23012 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2014-08-10 22:43:46 23012 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-08-10 22:43:46 23012 [Warning] InnoDB: New log files created, LSN=45781

2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer not found: creating new

2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer created

2014-08-10 22:43:46 23012 [Note] InnoDB: 128 rollback segment(s) are active.

2014-08-10 22:43:46 23012 [Warning] InnoDB: Creating foreign key constraint system tables.

2014-08-10 22:43:47 23012 [Note] InnoDB: Foreign key constraint system tables created

2014-08-10 22:43:47 23012 [Note] InnoDB: Creating tablespace and datafile system tables.

2014-08-10 22:43:47 23012 [Note] InnoDB: Tablespace and datafile system tables created.

2014-08-10 22:43:47 23012 [Note] InnoDB: Waiting for purge to start

2014-08-10 22:43:47 23012 [Note] InnoDB: 5.6.22 started; log sequence number 0

A random root password has been set. You will find it in '/root/.mysql_secret'.

2014-08-10 22:43:48 23012 [Note] Binlog end

2014-08-10 22:43:48 23012 [Note] InnoDB: FTS optimize thread exiting.

2014-08-10 22:43:48 23012 [Note] InnoDB: Starting shutdown...

2014-08-10 22:43:50 23012 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2014-08-10 22:43:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-08-10 22:43:50 23039 [Note] InnoDB: Using atomics to ref count buffer pool pages

2014-08-10 22:43:50 23039 [Note] InnoDB: The InnoDB memory heap is disabled

2014-08-10 22:43:50 23039 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2014-08-10 22:43:50 23039 [Note] InnoDB: Memory barrier is not used

2014-08-10 22:43:50 23039 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-08-10 22:43:50 23039 [Note] InnoDB: Using Linux native AIO

2014-08-10 22:43:50 23039 [Note] InnoDB: Not using CPU crc32 instructions

2014-08-10 22:43:50 23039 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-08-10 22:43:50 23039 [Note] InnoDB: Completed initialization of buffer pool

2014-08-10 22:43:50 23039 [Note] InnoDB: Highest supported file format is Barracuda.

2014-08-10 22:43:50 23039 [Note] InnoDB: 128 rollback segment(s) are active.

2014-08-10 22:43:50 23039 [Note] InnoDB: Waiting for purge to start

2014-08-10 22:43:50 23039 [Note] InnoDB: 5.6.22 started; log sequence number 1625977

2014-08-10 22:43:50 23039 [Note] Binlog end

2014-08-10 22:43:50 23039 [Note] InnoDB: FTS optimize thread exiting.

2014-08-10 22:43:50 23039 [Note] InnoDB: Starting shutdown...

2014-08-10 22:43:52 23039 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,

no other statement but 'SET PASSWORD' will be accepted.

See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at

The latest information about MySQL is available on the web at

Support MySQL by buying support/licenses at

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

3)检测 MySQL 3306 端口是否安打开。测试是否成功可运行 netstat 看 MySQL 端口是否打开,如打开表示服务已经启动,安装成功。MySQL 默认的端口是3306。

[root@hadoop Mysql]# netstat -nat

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN

tcp 0 0 192.168.128.129:9000 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:50090 0.0.0.0:* LISTEN

tcp 1 0 192.168.128.129:35744 63.130.76.64:80 CLOSE_WAIT

tcp 0 0 192.168.128.129:34847 192.168.128.129:9000 ESTABLISHED

tcp 0 0 192.168.128.129:35770 192.168.128.129:9000 TIME_WAIT

tcp 0 52 192.168.128.129:22 192.168.128.1:1297 ESTABLISHED

tcp 0 0 192.168.128.129:50968 61.135.185.247:80 ESTABLISHED

tcp 0 0 192.168.128.129:9000 192.168.128.129:34847 ESTABLISHED

tcp 0 0 :::34803 :::* LISTEN

tcp 0 0 :::22 :::* LISTEN

tcp 0 0 ::1:631 :::* LISTEN

tcp 0 0 :::8088 :::* LISTEN

tcp 0 0 :::13562 :::* LISTEN

tcp 0 0 :::8030 :::* LISTEN

tcp 0 0 :::8031 :::* LISTEN

tcp 0 0 :::8032 :::* LISTEN

tcp 0 0 :::8033 :::* LISTEN

tcp 0 0 :::8040 :::* LISTEN

tcp 0 0 :::8042 :::* LISTEN

tcp 0 0 ::ffff:192.168.128.129:8031 ::ffff:192.168.128.12:58051 ESTABLISHED

tcp 0 0 ::ffff:192.168.128.12:58051 ::ffff:192.168.128.129:8031 ESTABLISHED

4)启动MySql 服务

[root@hadoop Mysql]# service mysql start

Starting MySQL.......... SUCCESS!

5) 安装客户端

[root@hadoop Mysql]#rpm -ivh MySQL-client-5.6.22-1.linux_glibc2.5.x86_64.rpm

Preparing... ########################################### [100%]

1:MySQL-client ^C########################################### [100%] 安装完成

5)MySQL的几个重要目录。

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

centos 安装mysql5.6.22_CentOS 6.4 安装MySQL 5.6.22相关推荐

  1. centos 安装mysql5.7.19_centos7源码安装mysql5.7.19

    centos7源码包安装mysql5.7 5.7.20安装方法和5.7.19的一样. 1.安装前准备 清空环境.安装相应的软件包 1>关闭防火墙和SELinux 2>配置yum源(阿里云, ...

  2. centos 安装mysql5.6.22_centos 7.0 编译 安装mysql 5.6.22 过程 已完成~ 成功~ 撒花~

    mysql 下载目录/usr/local/src mysql 解压目录 /usr/local/bin/mysql GitHub https://github.com/mysql/mysql-serve ...

  3. centos 安装mysql5.7_Zabbix 4.2.5 安装部署实践详解

    [导读]云计算背景下,无论是大数据.物联网还是边缘计算,规模化后大量的设备需要保证正常运行,在人员一定的情况下,就需要提高运行维护效率.同时随着智能化被应用在人们生活的方方面面,关联性也越来越紧密,即 ...

  4. centos安装mysql5.7.19_Linux下Centos7安装Mysql5.7.19的详细教程

    1.下载mysql 2.选择源码包,通用版点击下载 直接下载就可以了,不用登录 3.解压编译 tar -zxvf mysql-5.7.19.tar.gz cd mysql-5.7.19.tar.gz ...

  5. centos 安装mysql5.6.20_Linux学习15-CentOS安装mysql5.6环境

    前言 在linux上安装mysql5.6版本,并远程连接mysql数据库操作 安装mysql mysql的安装可以用yum安装更方便 [root@yoyo ~]# cd /usr/local/ [ro ...

  6. mysql源 如何编译安装,MySQL5.7.22-源代码编译安装

    Centos下用cmake编译安装MySQL 5.7.22 环境:CentOS6.8 [root@li1164-33 mysql5722]# cat /etc/redhat-release CentO ...

  7. centos8安装mysql5.5_CentOS 6.8 编译安装MySQL5.5.32 (二 多实例)

    MySQL多实例的配置 通过上文 CentOS 6.8 编译安装MySQL5.5.32 ,我们完成了编译安装,接下配置多实例 本图借鉴徐亮伟"思维简图" 5,添加多实例目录[roo ...

  8. linux安装mysql5.6整套_Linux下安装MySQL5.6

    环境: 1.操作系统:CentOS release 6.8 (Final) 2.安装版本: mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz 3.下载地址:http: ...

  9. 二进制安装mysql5.6_轻松使用二进制安装Mysql5.6

    二进制安装mysql5.6 系统环境:Centos6.5 x86_64 mysql二进制包:mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz #解压tar包到指定安装 ...

  10. windows安装包安装mysql5.7_Windows7 64位压缩包安装MySQL5.7.9

    官网下载64bit MySQL5.7.9压缩包, 解压至安装位置 1. 创建my.ini文件, 内容如下 [mysqld] # Remove leading # and set to the amou ...

最新文章

  1. apache nginx mysql php_php+Apache2+Nginx+Mysql
  2. 2012自学CCNP路由与交换之四交换机初始化
  3. 计算机二级考数组吗,计算机二级考试!
  4. boost 文件操作
  5. C和指针之学习笔记(3)
  6. 高通BMS的研究 高通电量计
  7. DD-WRT安装与配置
  8. 一个让人不得不转的故事-《通宵达旦工资只有3200 博客网架构师艰难浪迹于北京》...
  9. win8系统中chm文件打不开怎么办
  10. PHP的抽象类和抽象方法 abstract
  11. WSA系列API函数
  12. 小程序快速生成朋友圈海报分享图
  13. 简单的学生成绩管理系统
  14. 【实操】python opencv将图片合成视频,并插入音频
  15. 【文献解读】RNAi技术在油菜基因功能研究中的应用
  16. 关于Tomcat启动失败的解决方案
  17. AccelStepper库
  18. i510400f和i59400f差距 i5 10400f和i5 9400f哪个好
  19. IDEA配置MAVEN_OPTS
  20. 蓝牙双向通讯【可自定义协议】SDK

热门文章

  1. 181201每日一句
  2. opencv 图像对比度、亮度值调整 和滑动条
  3. Atitit 未来数据库新特性展望目录1. 统一的翻页 21.1. 2 Easy Top-N
  4. Atitit pg10分区 总结 1.1. create table tmp_log (  1 1.2. -创建索引 1 1.3. 查看表 in pgadmin4 2 2. 二 分区表管理 2 2.1
  5. Atititi ui之道 attilax著 v3 s11.docx 1. 概览 2 1.1. 软件设计可分为两个部分:编码设计与UI设计 2 2. 用户界面设计的三大原则是:置界面于用户的控制之下;
  6. Atitit 数据库view视图使用推荐规范与最佳实践与方法
  7. atitit.TokenService v3 qb1  token服务模块的设计 新特性.docx
  8. Atitit 图像处理 灰度图片 灰度化的原理与实现
  9. Atitit.404错误解决标准流程and url汉字中文路径404错误resin4 resin chinese char path 404 err解决
  10. To B 创业的本质,是求增速与生存环境的平衡