Linux 5 下安装MySQL 5.6(RPM方式)
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方式)的更多相关文章
- Linux系统下安装配置JDK(rpm方式及tar.gz方式)
以前都是在Windows环境进行开发的,最近因工作需要:学习在Linux系统下搭建开发环境,自此记录搭建过程,以方便查阅. 本文借鉴了 Angel挤一挤 .小五 两位的博客. 准备材料: JDK下载链 ...
- 在linux系统下安装mysql详解,以及远程调用连接不上mysql的解决方法。
步骤: 1)查看CentOS自带的mysql 输入 rpm -qa | grep mysql 2)将自带的mysql卸载 3)上传Mysql的安装包到linux 4)安装mysql的依赖(不是必须) ...
- Linux系统下安装Mysql
原文档地址:http://www.itpub.net/thread-1766546-1-1.html 1.在Linux服务器上通过wget命令取得rpm包: wget –c http://dev.my ...
- MySql入门(2-1)windows下安装mysql的两种方式
一.下载mysql 1.下载解压MySQL 登录oracle主页,需要用户名和口令: lshengqi@netease.com/1wsx**** 下载路径:: https://dev.mysql.co ...
- Linux/CentOS下安装MySql RPM Bundle
一.下载对应的版本的MySql安装文件 1.下载路径 https://dev.mysql.com/downloads/mysql/ 2.选择对应的Linux版本和x86/x64位的安装文件 查看Lin ...
- Linux(Centos)下安装MySQL
转载:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 一.mysql简介 说到数据库,我们大多想到的是关 ...
- 【转】Linux系统上安装MySQL 5.5 rpm
1.准备工作 从MySQL官网上分别下载mysql服务器端于客户端包. 如: MySQL-server-5.5.15-1.linux2.6.x86_64.rpm和MySQL-client-5.5.15 ...
- Linux 环境下安装Mysql的步骤
一,以linux cent 6.9 安装mysql 5.6.39为例#下载安装包wget --no-check-certificate https://dev.mysql.com/get/Downlo ...
- Linux平台下安装MySQL
1.下载RPM包 http://dev.mysql.com/downloads/mysql/5.5.html#downloads 选择[Red Hat & Oracle Enterprise ...
随机推荐
- Debian6 安装Kscope(也适用于Ubuntu)
参考:http://soft.chinabyte.com/os/134/12307634.shtml kscope1.6.2在这里下载,下载后解压出kscope-1.6.2.tar.gz. 在ubun ...
- TSynDBSQLDataSet
TSynDBSQLDataSet 非内存表 TSynDBSQLDataSet = class(TSynBinaryDataSet) TSynBinaryDataSet = class(TSynVirt ...
- 解决小米手机Android Studio安装app 报错的问题It is possible that this issue is resolved by uninstalling an existi
问题描述 Android Studio升级到2.3版本之后,小米手机MIUI8不能运行Android Studio程序,报如下错误: Installation failed with message ...
- 关于shape和selector和layer-list的drawable详细说明
在Android开发中,但凡涉及控件的的特效问题,<shape>,<selector>以及<layer-list>都是不可或缺的drawable.但是发现有同事并不 ...
- gulp的入门浅析
阅读目录 介绍gulp 安装gulp gulpfile.js 运行gulp 介绍gulp的api 介绍gulp gulp是基于Nodejs的自动任务运行器, 她能自动化地完成 javascript/c ...
- iOS:二维码的生成
所谓的二维码就是一个图片,只不过在iOS需要借用<CoreImage/CoreImage.h>来实现, 并且二维码图片是通过CIImage来转成UIImage的.具体步骤如下: // 1 ...
- 1-N中1出现的次数
/*标记1-N中1出现的次数.例如,当N等于18时,1出现的次数为2 + 9 = 11 个位数出现1的为:1,11,十位数出现1的为10-18*/public class OneNoInN { // ...
- 用聚合数据API(苏州实时公交API)快速写出小程序
利用聚合数据API快速写出小程序,过程简单. 1.申请小程序账号 2.进入开发 3.调用API.比如“苏州实时公交”小程序,选择的是苏州实时公交API. 苏州实时公交API文档:https://www ...
- java注解说明
* 元注解@Target,@Retention,@Documented,@Inherited * * @Target 表示该注解用于什么地方,可能的 ElemenetType 参数包括: * Elem ...
- react-native 模仿原生 实现下拉刷新/上拉加载更多(RefreshListView)
1.下拉刷新/上拉加载更多 组件(RefreshListView) src/components/RefreshListView/index.js /** * 下拉刷新/上拉加载更多 组件(Refre ...