MySQL在很多领域被广泛使用,尤其是很多互联网企业,诸如腾讯,阿里等等。本文主要介绍在Linux 5下通过rpm方式来安装Mysql,这是比较简单的一种安装方式,具体详见下文。
《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm
1、准备对应的安装文件
下载页面:http://dev.mysql.com/downloads/mysql/
找到对应的版本及所需的文件进行下载,如果下载的为tar文件,请使用tar解压
本人在Oracle Edelivery 下载,所以为V44331-01.zip
#安装环境
[root@linux1 Mysql_src]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Kernel \r on an \m
#源文件路径
[root@linux1 Mysql_src]# pwd
/Mysql_src
[root@linux1 Mysql_src]# unzip V44331-01.zip
Archive:  V44331-01.zip
 extracting: MySQL-embedded-advanced-5.6.17-1.rhel5.i386.rpm  
 extracting: MySQL-test-advanced-5.6.17-1.rhel5.i386.rpm  
 extracting: MySQL-shared-advanced-5.6.17-1.rhel5.i386.rpm          # MySQL的共享库
 extracting: MySQL-devel-advanced-5.6.17-1.rhel5.i386.rpm          # MySQL的库和头文件
 extracting: MySQL-client-advanced-5.6.17-1.rhel5.i386.rpm          # MySQL客户端程序
 extracting: MySQL-server-advanced-5.6.17-1.rhel5.i386.rpm          # MySQL服务端程序
 extracting: MySQL-shared-compat-advanced-5.6.17-1.rhel5.i386.rpm  # RHEL兼容包
 extracting: README.txt              
 
2、MySQL默认安装路径
 Directory            Contents of Directory
/usr/bin              Client programs and scripts
/usr/sbin              The mysqld server
/var/lib/mysql        Log files, databases
/usr/share/info        Manual in Info format
/usr/share/man        Unix manual pages
/usr/include/mysql    Include (header) files
/usr/lib/mysql        Libraries
/usr/share/mysql      Miscellaneous support files, including error messages,
                        character set files, sample configuration files, SQL for database installation
/usr/share/sql-bench  Benchmarks
 
3、安装MySQL
[root@linux1 Mysql_src]# rpm -ivh MySQL-server-advanced-5.6.17-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
  1:MySQL-server-advanced  ########################################### [100%]
2014-04-15 17:26:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-04-15 17:26:59 6524 [Note] InnoDB: Using mutexes to ref count buffer pool pages
                  ...........................
2014-04-15 17:27:06 6558 [Note] InnoDB: FTS optimize thread exiting.
2014-04-15 17:27:06 6558 [Note] InnoDB: Starting shutdown...
2014-04-15 17:27:08 6558 [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
#  Author : Leshami
#  Blog  : http://www.linuxidc.com
which will also give you the option of removing the test database.
This is strongly recommended for production servers.
                  ...........中间省略................
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
[root@linux1 Mysql_src]# rpm -ivh MySQL-client-advanced-5.6.17-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
  1:MySQL-client-advanced  ########################################### [100%]
[root@linux1 Mysql_src]# rpm -ivh MySQL-devel-advanced-5.6.17-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
  1:MySQL-devel-advanced  ########################################### [100%]
更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-04/100535p2.htm

4、初始化MySQL及密码
[root@linux1 Mysql_src]# service mysql start
Starting MySQL.. [ OK ]
[root@linux1 Mysql_src]# more /root/.mysql_secret
# The random password set for the root user at Tue Apr 15 17:27:05 2014 (local time): lyHfNb87EBXhJDe2
[root@linux1 Mysql_src]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17-enterprise-commercial-advanced
mysql> set PASSWORD=PASSWORD('mysql');
Query OK, 0 rows affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.03 sec)
 
5、允许远程登陆
mysql> use mysql;
Database changed
mysql> select host,user,password from user;
+-------------------+------+-------------------------------------------+
| host | user | password |
+-------------------+------+-------------------------------------------+
| localhost | root | *E74858DB86EBA20BC33D0AECAE8A8108C56B17FA |
| linux1.orasrv.com | root | *AE207AEF7D22B37183E435AAE64CECF7102A2DB2 |
| 127.0.0.1 | root | *AE207AEF7D22B37183E435AAE64CECF7102A2DB2 |
| ::1 | root | *AE207AEF7D22B37183E435AAE64CECF7102A2DB2 |
+-------------------+------+-------------------------------------------+
4 rows in set (0.02 sec)
mysql> update user set password=password('mysql') where user='root';
mysql> update user set host='%' where user='root' and host='localhost';
mysql> flush privileges;
mysql> exit
6、配置开机自启动
[root@linux1 Mysql_src]# chkconfig --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
如果没有的话使用chkconfig mysql on 设置自启动

Linux 5 下安装MySQL 5.6(RPM方式)的更多相关文章

  1. Linux系统下安装配置JDK(rpm方式及tar.gz方式)

    以前都是在Windows环境进行开发的,最近因工作需要:学习在Linux系统下搭建开发环境,自此记录搭建过程,以方便查阅. 本文借鉴了 Angel挤一挤 .小五 两位的博客. 准备材料: JDK下载链 ...

  2. 在linux系统下安装mysql详解,以及远程调用连接不上mysql的解决方法。

    步骤: 1)查看CentOS自带的mysql 输入 rpm -qa | grep mysql 2)将自带的mysql卸载 3)上传Mysql的安装包到linux 4)安装mysql的依赖(不是必须) ...

  3. Linux系统下安装Mysql

    原文档地址:http://www.itpub.net/thread-1766546-1-1.html 1.在Linux服务器上通过wget命令取得rpm包: wget –c http://dev.my ...

  4. MySql入门(2-1)windows下安装mysql的两种方式

    一.下载mysql 1.下载解压MySQL 登录oracle主页,需要用户名和口令: lshengqi@netease.com/1wsx**** 下载路径:: https://dev.mysql.co ...

  5. Linux/CentOS下安装MySql RPM Bundle

    一.下载对应的版本的MySql安装文件 1.下载路径 https://dev.mysql.com/downloads/mysql/ 2.选择对应的Linux版本和x86/x64位的安装文件 查看Lin ...

  6. Linux(Centos)下安装MySQL

    转载:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 一.mysql简介 说到数据库,我们大多想到的是关 ...

  7. 【转】Linux系统上安装MySQL 5.5 rpm

    1.准备工作 从MySQL官网上分别下载mysql服务器端于客户端包. 如: MySQL-server-5.5.15-1.linux2.6.x86_64.rpm和MySQL-client-5.5.15 ...

  8. Linux 环境下安装Mysql的步骤

    一,以linux cent 6.9 安装mysql 5.6.39为例#下载安装包wget --no-check-certificate https://dev.mysql.com/get/Downlo ...

  9. Linux平台下安装MySQL

    1.下载RPM包 http://dev.mysql.com/downloads/mysql/5.5.html#downloads 选择[Red Hat & Oracle Enterprise ...

随机推荐

  1. Linux下使用split按行数进行切割

    说明:一般来说split按行数切割多数用在日志文件上. 实例: 将一个大文件分成若干个小文件方法: 例如将一个BLM.txt文件分成前缀为BLM_ 的1000个小文件,后缀为系数形式,且后缀为4位数字 ...

  2. Word2010插入页码分节符

    不是分页符,分节符主要是为了插入前后两种不同类型的页码,比如前面查罗马数字,从目录开始插入阿拉伯数字.                 

  3. js调试方法

    参考:1.https://developers.google.com/web/tools/chrome-devtools/javascript/ 2.https://developers.google ...

  4. gulp的入门浅析

    阅读目录 介绍gulp 安装gulp gulpfile.js 运行gulp 介绍gulp的api 介绍gulp gulp是基于Nodejs的自动任务运行器, 她能自动化地完成 javascript/c ...

  5. iOS:友盟SDK分享

    友盟SDK分享   基本步骤: 1.注册友盟开发者账号 2.登陆账号,添加新应用,获取AppKey 3.下载并安装SDK 4.解压SDK压缩包,将形如UMSocial_sdk_x.x.x文件拖入工程中 ...

  6. centos7 ping127.0.0.1不通

    ping 127.0.0.1,localhost和本地ip都不通,所有的配置也是正确的 检查下是否禁止了ping vim /proc/sys/net/ipv4/icmp_echo_ignore_all ...

  7. unity backbuffer

    拿unity backbuffer的方法 var  backbuffer = new RenderTargetIdentifier(BuiltinRenderTextureType.None); 这个 ...

  8. D3.js系列——布局:饼状图和力导向图

    一.饼状图 在布局的应用中,最简单的就是饼状图. 1.数据 有如下数据,需要可视化: , , , , ]; 这样的值是不能直接绘图的.例如绘制饼状图的一个部分,需要知道一段弧的起始角度和终止角度,这些 ...

  9. 【玩转cocos2d-x之三十九】Cocos2d-x 3.0截屏功能集成

    3.0的截屏和2.x的截屏基本上同样.都是利用RenderTexture来处理,在渲染之前调用call函数,然后调用Cocos的场景visit函数对其进行渲染,渲染结束后调用end函数就可以.仅仅是3 ...

  10. 使RESTful Web服务更加实用的10个建议

    提示:随着RESTful Web services的流行程度不断地上升,开发人员需要知道如何避免开发中的陷阱以及让开发出来的Web service达到自己能做到的最好程度. 过去的几年里,我们看到RE ...