1.查看操作系统相关信息。

[root@linuxidc ~]# cat /etc/issue 
CentOS release 6.5 (Final) 
Kernel \r on an \m 
[root@linuxidc ~]# uname -a 
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

2.创建需要下载rpm软件包的目录。
1 [root@linuxidc ~]# mkdir -p /taokey/tools

3.查看下是否有系统自带mysql的rpm包,如果有,需要删除自带的旧rpm包。
[root@linuxidc ~]# rpm -qa | grep mysql 
mysql-libs-5.1.71-1.el6.x86_64 
[root@linuxidc ~]# yum -y remove mysql-libs-5.1* 
[root@linuxidc ~]# rpm -qa | grep mysql 
[root@linuxidc ~]#

4.在MySQL官网下载安装MySQL-5.6.21所需的rpm软件包。
需要下载三个rpm软件包:
MySQL-client-5.6.21-1.rhel5.x86_64.rpm  
MySQL-devel-5.6.21-1.rhel5.x86_64.rpm  
MySQL-server-5.6.21-1.rhel5.x86_64.rpm 
[root@linuxidc ~]# cd /taokey/tools/ 
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm 
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm 
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

5.下载完之后,安装三个rpm软件包。
[root@linuxidc tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm 
error: Failed dependencies:
        libaio.so.1()(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
        libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
        libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
安装MySQL-server报错,原因是没有安装libaio,系统缺少libaio.so此软件包,下边yum安装一下libaio.so软件包。
[root@linuxidc tools]# yum install -y libaio 
[root@linuxidc tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm 
[root@linuxidc tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm  
Preparing...                ########################################### [100%] 
  1:MySQL-client          ########################################### [100%] 
[root@linuxidc tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm  
Preparing...                ########################################### [100%] 
  1:MySQL-devel            ########################################### [100%]

6.修改配置文件位置。
[root@linuxidc tools]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

7.初始化MySQL及修改MySQL默认的root密码。
[root@linuxidc tools]# /usr/bin/mysql_install_db 
[root@linuxidc tools]# ps -ef | grep mysql 
root      2188    1  0 14:48 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/linuxidc.pid 
mysql    2303  2188 30 14:48 pts/1    00:00:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/linuxidc.err --pid-file=/var/lib/mysql/linuxidc.pid 
root      2331  1853  0 14:49 pts/1    00:00:00 grep mysql 
[root@linuxidc tools]# netstat -anpt | grep 3306 
tcp        0      0 :::3306                    :::*                        LISTEN      2303/mysqld
[root@linuxidc tools]# more /root/.mysql_secret 
# The random password set for the root user at Thu Apr  9 14:43:59 2015 (local time): F6K3v_xggFoLQeiN 
  
[root@linuxidc tools]# mysql -uroot -pF6K3v_xggFoLQeiN 
Warning: Using a password on the command line interface can be insecure. 
Welcome to the MySQL monitor.  Commands end with ; or \g. 
Your MySQL connection id is 1 
Server version: 5.6.21 
  
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 
  
Oracle is a registered trademark of Oracle Corporation and/or its 
affiliates. Other names may be trademarks of their respective 
owners. 
  
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
  
mysql> SET PASSWORD = PASSWORD('123.com');  
mysql> exit
Bye 
[root@linuxidc tools]# mysql -uroot -p123.com 
Warning: Using a password on the command line interface can be insecure. 
Welcome to the MySQL monitor.  Commands end with ; or \g. 
Your MySQL connection id is 6 
Server version: 5.6.21 MySQL Community Server (GPL) 
  
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 
  
Oracle is a registered trademark of Oracle Corporation and/or its 
affiliates. Other names may be trademarks of their respective 
owners. 
  
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
  
mysql>

8.设置MySQL服务开机自启动。
[root@linuxidc tools]# chkconfig mysql on 
[root@linuxidc tools]# chkconfig mysql --list 
mysql          0:off  1:off  2:on    3:on    4:on    5:on    6:off

到此为止,使用RPM安装MySQL5.6版本数据库安装完毕,谢谢大家。

CentOS 6.5下安装MySQL 5.6.21  http://www.linuxidc.com/Linux/2015-01/111413.htm

本文永久更新链接地址http://www.linuxidc.com/Linux/2015-04/116003.htm

centos6.5安装mysql记录的更多相关文章

  1. Centos6.6安装mysql记录

    一.环境介绍: 系统:Cerntos6.6 Mysql版本:mysql-5.6.34 二.安装操作: 1.卸载旧版本: rpm -qa |grep mysql mysql-server-5.1.73- ...

  2. Mysql系列三:Centos6下安装Mysql和Mysql主从复制的搭建

    一.Centos6下安装Mysql 检测下系统有没有自带的mysql:yum list installed | grep mysql, 如果已经有的话执行命令yum -y remove mysql-l ...

  3. Centos6.5 安装MYSQL 5.5 -5.6.-5.7 一键yum快速安装 ,初始配置

    Centos6.5 安装MYSQL 5.5 ---5.6---5.7 一键yum快速安装 ,初始配置 第一步:安装mysql-5.5---- 5.6 ---- 5.7的yum源 [root@sv03 ...

  4. 【转】CentOS6下安装mysql后,重置root密码方法

    本文转自:CentOS6下安装mysql后,重置root密码方法 centos下安装mysql,居然不知道root用户密码,本想重装,不过还是先度娘了一些,发现这篇文章,刚好解决我的燃眉之急,太赞了. ...

  5. CentOS6.9安装MySQL(编译安装、二进制安装)

    目录 CentOS6.9安装MySQL Linux安装MySQL的4种方式: 1. 二进制方式 特点:不需要安装,解压即可使用,不能定制功能 2. 编译安装 特点:可定制,安装慢 5.5之前: ./c ...

  6. Centos6 系统下源码方式安装Mysql 记录

    在运维工作中经常部署各种运维环境,涉及mysql数据库的安装也是时常需要的.mysql数据库安装可以选择yum在线安装,但是这种安装的mysql一般是系统自带的,版本方面可能跟需求不太匹配. #### ...

  7. CentOS6.5安装mysql以及常见问题的解决

    前言 最近在学习Linux系统,今天在安装MySQL数据库时出现很多问题,花费了两个小时终于解决,故记录下来以供大家参考.(本人目前还在学习阶段,下面写到的是自己结合网上查到的资料以及各位前辈给出的解 ...

  8. centos6.8yum 安装mysql

    1:查看是否已有mysql版本 rpm -qa | grep mysql 删除mysql 账号和用户组 删除/etc/my.cnf 2:有的话就删除 rpm -e mysql-...... 或者 co ...

  9. centos6.5安装mysql(转载,亲测可用)

    如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了Linux学习之CentOS(七)--Cen ...

随机推荐

  1. ExtJS ComboBox的用法+代码

    Ext.onReady(function() { var store = Ext.create('Ext.data.Store', { autoLoad : true, fields : ['valu ...

  2. Linux 的多线程编程的高效开发经验(转)

    http://www.ibm.com/developerworks/cn/linux/l-cn-mthreadps/ 背景 Linux 平台上的多线程程序开发相对应其他平台(比如 Windows)的多 ...

  3. eclipse adt 项目依赖,使用git上的项目

    从git下载的android工程不能直接导入eclipse,有的项目要依赖这个项目,怎么办呢 好像只能新建一个android项目,然后把libs,res,src,AndroidManifest.xml ...

  4. PS CS5

    1.图层 背景图层:双击解锁 右下按键:新建图层.删除图层.新建图层组 眼睛-图层的显示与隐藏 缩略图大小选择:右上三角-面板设置 打开那个图片然后选择工具里面的移动工具然后按住鼠标拖动,拖到那个图片 ...

  5. 归档-ios

    /****普通对象归档**/ NSString *homePath=NSHomeDirectory(); NSString *fileName=@"test.vse"; NSStr ...

  6. JavaScript中“javascript:void(0) ”是什么意思

    来源: <a href="javascript:test();void(0);">here</a> 此处:Javascript中void是一个操作符,该操作 ...

  7. MVC 自定义异常错误页面处理

    1.配置文件:webConfig中配置经常出现的错误页面: <system.web>节点下添加 <customErrors>节点,在 <customErrors>节 ...

  8. 【Android】【录音】Android录音--AudioRecord、MediaRecorder

    [Android][录音]Android录音--AudioRecord.MediaRecorder Android提供了两个API用于实现录音功能:android.media.AudioRecord. ...

  9. python psutil 模块

    一.获取系统性能信息 1 .CPU信息 User time,执行用户进程的时间百分比 System time,执行内核进程和中断的百分比 Wait IO,由于IO等待而使CPU处于idle(空闲)状态 ...

  10. 解决方案:将已存在的项目 添加到 tfs解决方案中的时候 出现:新项目不能成功加入源码控制

    遇到此问题 可能是因为你的 解决方案文件 没有正确与 tfs服务器绑定导致的 解决方式是: 在打开任意一个源码文件的时候,打开 vs2013的 文件>> Go to File->So ...