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 ...
随机推荐
- java.sql.SQLException: Access denied for user ''@'localhost' (using password: No)
出错原因: 连接数据库是忘记配username 和 password 了 刚在学hiberbate4,把持久层从纯粹的jdbc改为hiberbate 出现的错误.(原来的是直接读取properties ...
- Codeforces 920 G List Of Integers
题目描述 Let's denote as L(x,p)L(x,p) an infinite sequence of integers yy such that gcd(p,y)=1gcd(p,y)=1 ...
- [Contest20180325]序列
Hogura有一个序列$a$,她希望你帮她维护下面的这些操作. $1\ l\ r\ x$对$l\leq i\leq r$的$a_i$执行$a_i=a_i+x$ $2\ l\ r\ x$对$l\leq ...
- 【循环节】 Codeforces Round #401 (Div. 2) A. Shell Game
容易发现存在循环节. #include<cstdio> using namespace std; int n,x,a[3][6]={{0,1,2,2,1,0},{1,0,0,1,2,2}, ...
- python基础-匿名函数、内置函数、正则表达式、模块
1. 匿名函数 1.1 有名函数 有名函数:定义了一个函数名,函数名指向内存地址:通过函数名进行访问.函数名加括号就可以运行有名函数,例如:func() def func(x, y, z = 1): ...
- matlab和c混合编程
参考: http://blog.sciencenet.cn/blog-620659-579885.html http://baike.baidu.com/link?url=HnHd3lU9mcVXwh ...
- Scala零基础教学【81-89】
第81讲:Scala中List的构造是的类型约束逆变.协变.下界详解 首先复习四个概念——协变.逆变.上界.下界 对于一个带类型参数的类型,比如 List[T]: 如果对A及其子类型B,满足 List ...
- 数据库问题5-SYS.SYSPROCESSES使用和查找死锁
http://blog.sina.com.cn/s/blog_62c4727d0100jc5z.html (一)理論部份 sys.sysprocesses (Transact-SQL) http:// ...
- 64位下安装Scrapy 报错 "could not find openssl.exe" 的解决方法。
其实就是安装对应的64位 pyOpenSSL 就行了, 下载地址如下: https://tahoe-lafs.org/source/tahoe-lafs/deps/tahoe-lafs-dep-egg ...
- Jigsaw 项目:Java 模块系统新手引导
前言 随着 2017 年 10 月 Java 9 的发布,Java 能够使用模块系统了,但是中文互联网上的资料太少,许多关于 Java 模块系统的文章都只是介绍了模块系统的好处,或者给了一些毫无组织的 ...