阿里云Centos7使用yum安装MySQL5.6

阿里云Centos7使用yum安装MySQL5.6


前言:由于某些不可抗力,我要在自己的阿里云服务器上搭建hadoop+hive+mysql+tomcat环境,下为mysql的安装记录


→_→大家都知道,centos自带的repo是不会自动更新每个软件的最新版本,所以无法通过yum方式安装MySQL的高级版本。所以,即使我使劲用yum -y install mysql mysql-server mysql-devel,也是没有人会鸟我的。

所以,正确的安装mysql5姿势是要先安装带有可用的mysql5系列社区版资源的rpm包

1.[root@iZ28gvqe4biZ ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
2.获取http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
3.准备中... ################################# [100%]
4.正在升级/安装...
5. 1:mysql-community-release-el7-5 ################################# [100%]
6.

这个时候查看当前可用的mysql安装资源:

1.[root@iZ28gvqe4biZ ~]# yum repolist enabled | grep "mysql.*-community.*"
2.mysql-connectors-community/x86_64 MySQL Connectors Community 17
3.mysql-tools-community/x86_64 MySQL Tools Community 31
4.mysql56-community/x86_64 MySQL 5.6 Community Server 199
5.

一般来说,只要安装mysql-server跟mysql-client

这个时候我们可以直接使用yum的方式安装MySQL了

1.[root@iZ28gvqe4biZ ~]# yum -y install mysql-community-server
2.已加载插件:langpacks
3.正在解决依赖关系
4.--> 正在检查事务
5.---> 软件包 mysql-community-server.x86_64.0.5.6.28-2.el7 将被 安装
6.--> 正在处理依赖关系 mysql-community-common(x86-64) = 5.6.28-2.el7,它被软件包 mysql-community-server-5.6.28-2.el7.x86_64 需要
7.--> 正在处理依赖关系 mysql-community-client(x86-64) = 5.6.28-2.el7,它被软件包 mysql-community-server-5.6.28-2.el7.x86_64 需要
8.--> 正在处理依赖关系 perl(DBI),它被软件包 mysql-community-server-5.6.28-2.el7.x86_64 需要
9.--> 正在检查事务
10.---> 软件包 mysql-community-client.x86_64.0.5.6.28-2.el7 将被 安装
11.--> 正在处理依赖关系 mysql-community-libs(x86-64) = 5.6.28-2.el7,它被软件包 mysql-community-client-5.6.28-2.el7.x86_64 需要
12.---> 软件包 mysql-community-common.x86_64.0.5.6.28-2.el7 将被 安装
13.---> 软件包 perl-DBI.x86_64.0.1.627-4.el7 将被 安装
14.--> 正在处理依赖关系 perl(RPC::PlServer) >= 0.2001,它被软件包 perl-DBI-1.627-4.el7.x86_64 需要
15.--> 正在处理依赖关系 perl(RPC::PlClient) >= 0.2000,它被软件包 perl-DBI-1.627-4.el7.x86_64 需要
16.--> 正在检查事务
17.---> 软件包 mariadb-libs.x86_64.1.5.5.40-1.el7_0 将被 取代
18.---> 软件包 mysql-community-libs.x86_64.0.5.6.28-2.el7 将被 舍弃
19.---> 软件包 perl-PlRPC.noarch.0.0.2020-14.el7 将被 安装
20.--> 正在处理依赖关系 perl(Net::Daemon) >= 0.13,它被软件包 perl-PlRPC-0.2020-14.el7.noarch 需要
21.--> 正在处理依赖关系 perl(Net::Daemon::Test),它被软件包 perl-PlRPC-0.2020-14.el7.noarch 需要
22.--> 正在处理依赖关系 perl(Net::Daemon::Log),它被软件包 perl-PlRPC-0.2020-14.el7.noarch 需要
23.--> 正在处理依赖关系 perl(Compress::Zlib),它被软件包 perl-PlRPC-0.2020-14.el7.noarch 需要
24.--> 正在检查事务
25.---> 软件包 perl-IO-Compress.noarch.0.2.061-2.el7 将被 安装
26.--> 正在处理依赖关系 perl(Compress::Raw::Zlib) >= 2.061,它被软件包 perl-IO-Compress-2.061-2.el7.noarch 需要
27.--> 正在处理依赖关系 perl(Compress::Raw::Bzip2) >= 2.061,它被软件包 perl-IO-Compress-2.061-2.el7.noarch 需要
28.---> 软件包 perl-Net-Daemon.noarch.0.0.48-5.el7 将被 安装
29.--> 正在检查事务
30.---> 软件包 perl-Compress-Raw-Bzip2.x86_64.0.2.061-3.el7 将被 安装
31.---> 软件包 perl-Compress-Raw-Zlib.x86_64.1.2.061-4.el7 将被 安装
32.--> 解决依赖关系完成
33.
34.依赖关系解决
35.
36.==============================================================================================
37. Package 架构 版本 源 大小
38.==============================================================================================
39.正在安装:
40. mysql-community-libs x86_64 5.6.28-2.el7 mysql56-community 2.0 M
41. 替换 mariadb-libs.x86_64 1:5.5.40-1.el7_0
42. mysql-community-server x86_64 5.6.28-2.el7 mysql56-community 58 M
43.为依赖而安装:
44. mysql-community-client x86_64 5.6.28-2.el7 mysql56-community 19 M
45. mysql-community-common x86_64 5.6.28-2.el7 mysql56-community 256 k
46. perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
47. perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
48. perl-DBI x86_64 1.627-4.el7 base 802 k
49. perl-IO-Compress noarch 2.061-2.el7 base 260 k
50. perl-Net-Daemon noarch 0.48-5.el7 base 51 k
51. perl-PlRPC noarch 0.2020-14.el7 base 36 k
52.
53.事务概要
54.==============================================================================================
55.安装 2 软件包 (+8 依赖软件包)
56.
57.总下载量:80 M
58.Downloading packages:
59.警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.28-2.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
60.mysql-community-common-5.6.28-2.el7.x86_64.rpm 的公钥尚未安装
61.(1/10): mysql-community-common-5.6.28-2.el7.x86_64.rpm | 256 kB 00:00:14
62.(2/10): mysql-community-libs-5.6.28-2.el7.x86_64.rpm | 2.0 MB 00:02:57
63.(3/10): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
64.(4/10): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
65.(5/10): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
66.(6/10): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
67.(7/10): perl-PlRPC-0.2020-14.el7.noarch.rpm
68.(8/10): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
69.(9/10): mysql-community-server-5.6.28-2.el7.x86_64.rpm | 58 MB 00:54:45
70.(10/10): mysql-community-client-5.6.28-2.el7.x86_64.rpm | 19 MB 00:20:42
71.总计 13 kB/s | 80 MB 01:45:50
72.从 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
73.导入 GPG key 0x5072E1F5:
74. 用户ID : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
75. 指纹 : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
76. 软件包 : mysql-community-release-el7-5.noarch (installed)
77. 来自 : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
78.Running transaction check
79.Running transaction test
80.Transaction test succeeded
81.Running transaction
82.警告:RPM 数据库已被非 yum 程序修改。
83. 正在安装 : mysql-community-common-5.6.28-2.el7.x86_64 1/11
84. 正在安装 : mysql-community-libs-5.6.28-2.el7.x86_64 2/11
85. 正在安装 : mysql-community-client-5.6.28-2.el7.x86_64 3/11
86. 正在安装 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 4/11
87. 正在安装 : perl-Net-Daemon-0.48-5.el7.noarch 5/11
88. 正在安装 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 6/11
89. 正在安装 : perl-IO-Compress-2.061-2.el7.noarch 7/11
90. 正在安装 : perl-PlRPC-0.2020-14.el7.noarch 8/11
91. 正在安装 : perl-DBI-1.627-4.el7.x86_64 9/11
92. 正在安装 : mysql-community-server-5.6.28-2.el7.x86_64 10/11
93. 正在删除 : 1:mariadb-libs-5.5.40-1.el7_0.x86_64 11/11
94. 验证中 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/11
95. 验证中 : perl-Net-Daemon-0.48-5.el7.noarch 2/11
96. 验证中 : mysql-community-common-5.6.28-2.el7.x86_64 3/11
97. 验证中 : perl-IO-Compress-2.061-2.el7.noarch 4/11
98. 验证中 : mysql-community-libs-5.6.28-2.el7.x86_64 5/11
99. 验证中 : mysql-community-client-5.6.28-2.el7.x86_64 6/11
100. 验证中 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 7/11
101. 验证中 : perl-DBI-1.627-4.el7.x86_64 8/11
102. 验证中 : mysql-community-server-5.6.28-2.el7.x86_64 9/11
103. 验证中 : perl-PlRPC-0.2020-14.el7.noarch 10/11
104. 验证中 : 1:mariadb-libs-5.5.40-1.el7_0.x86_64 11/11
105.
106.已安装:
107. mysql-community-libs.x86_64 0:5.6.28-2.el7 mysql-community-server.x86_64 0:5.6.28-2.el7
108.
109.作为依赖被安装:
110. mysql-community-client.x86_64 0:5.6.28-2.el7 mysql-community-common.x86_64 0:5.6.28-2.el7
111. perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
112. perl-DBI.x86_64 0:1.627-4.el7 perl-IO-Compress.noarch 0:2.061-2.el7
113. perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7
114.
115.替代:
116. mariadb-libs.x86_64 1:5.5.40-1.el7_0
117.
118.完毕!
119.

安装完的配置

加入开机启动

1.[root@iZ28gvqe4biZ ~]# systemctl enable mysqld

启动mysql服务进程

1.[root@iZ28gvqe4biZ ~]# systemctl start mysqld

重置密码

1.[root@iZ28gvqe4biZ ~]# mysql_secure_installation
2.
3.
4.
5.NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
6. SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
7.
8.In order to log into MySQL to secure it, we'll need the current
9.password for the root user. If you've just installed MySQL, and
10.you haven't set the root password yet, the password will be blank,
11.so you should just press enter here.
12.
13.Enter current password for root (enter for none):
14.OK, successfully used password, moving on...
15.
16.Setting the root password ensures that nobody can log into the MySQL
17.root user without the proper authorisation.
18.
19.Set root password? [Y/n] y [设置root用户密码]
20.New password:
21.Re-enter new password:
22.Password updated successfully!
23.Reloading privilege tables..
24. ... Success!
25.
26.
27.By default, a MySQL installation has an anonymous user, allowing anyone
28.to log into MySQL without having to have a user account created for
29.them. This is intended only for testing, and to make the installation
30.go a bit smoother. You should remove them before moving into a
31.production environment.
32.
33.Remove anonymous users? [Y/n] y [删除匿名用户]
34. ... Success!
35.
36.Normally, root should only be allowed to connect from 'localhost'. This
37.ensures that someone cannot guess at the root password from the network.
38.
39.Disallow root login remotely? [Y/n] n [禁止root远程登录]
40. ... skipping.
41.
42.By default, MySQL comes with a database named 'test' that anyone can
43.access. This is also intended only for testing, and should be removed
44.before moving into a production environment.
45.
46.Remove test database and access to it? [Y/n] y [删除test数据库]
47. - Dropping test database...
48.ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
49. ... Failed! Not critical, keep moving...
50. - Removing privileges on test database...
51. ... Success!
52.
53.Reloading the privilege tables will ensure that all changes made so far
54.will take effect immediately.
55.
56.Reload privilege tables now? [Y/n] y [刷新权限]
57. ... Success!
58.
59.
60.
61.
62.All done! If you've completed all of the above steps, your MySQL
63.installation should now be secure.
64.
65.Thanks for using MySQL!
66.
67.
68.Cleaning up...
69.

新建Hive知识库

1.//登录MYSQL(有ROOT权限)。这里我以ROOT身份登录
2.[root@iZ28gvqe4biZ ~]# mysql -u root -p
3.//首先为用户创建一个数据库hivemeta
4.mysql > create database hivemeta;
5.mysql > use hivemeta
6.//授权hdp用户拥有hivemeta数据库的所有权限。
7.mysql > grant all privileges on *.* to hdp@"%" identified by "hdp" with grant option;
8.//刷新系统权限表
9.mysql > flush privileges;
10.mysql > use hivemeta;
11.//mysql/hive字符集问题
12.mysql > alter database hivemeta character set latin1;

阿里云Centos7使用yum安装MySQL5.6的正确姿势的更多相关文章

  1. Centos7使用yum安装MySQL5.6的正确姿势

    centos自带的repo是不会自动更新每个软件的最新版本,所以无法通过yum方式安装MySQL的高级版本. 所以,即使使劲用yum -y install mysql mysql-server mys ...

  2. 阿里云centos7.2自己安装mysql5.7远程不能访问解决方案

    版权声明:转载也行 https://blog.csdn.net/u010955892/article/details/72774920 最近,无意中看到阿里云服务器降价,所以一时手痒,买了一年的服务器 ...

  3. 阿里云 CentOS7.4 环境安装mysql5.7

    1. 删除默认安装的数据库,无所谓的请略过 据说CentOS7.x版本会默认安装mariadb数据库,我有点强迫症,故卸载之: rpm -qa|grep mariadb yum remove mari ...

  4. 阿里云centos7使用yum安装mysql的正确姿势

    yum快速安装mysql 新增yum源 rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 查看可用的 ...

  5. CentOS7 通过YUM安装MySQL5.7 linux

    CentOS7 通过YUM安装MySQL5.7 1.进入到要存放安装包的位置 cd /home/lnmp 2.查看系统中是否已安装 MySQL 服务,以下提供两种方式: rpm -qa | grep  ...

  6. CentOS7使用yum安装mysql5.7

    提前说一下,网速不好不要用yum安装,等得时间太长. 第一步.获取yum源 [root@youxi1 ~]# rpm -ivh https://repo.mysql.com/yum/mysql-5.7 ...

  7. 阿里云CentOS7系列一 -- 安装JDK7的方法.

    最近因为数据采集以及生产环境冲突.导入windows Server 2008系统经常死机.经讨论决定把采集服务程序和生产服务进行分开.采集程序通过windows Server2008运行.而生产程序通 ...

  8. 随笔编号-12 阿里云CentOS7系列一 -- 安装JDK7的方法.

    最近因为数据采集以及生产环境冲突.导入windows Server 2008系统经常死机.经讨论决定把采集服务程序和生产服务进行分开.采集程序通过windows Server2008运行.而生产程序通 ...

  9. centos7.6 yum安装mysql5.7版本

    由于mysql5.5及之前的版本一些项目上线报错 卸载: 首先删除centos上原来的mysql老版本,注意备份,清理干净. 之前怎么安装的清理,防止卸载不干净会有冲突. 我之前yum安装mysql5 ...

随机推荐

  1. php 如何写入、读取word,excel文档

    如何在php写入.读取word文档 <? //如何在php写入.读取word文档 // 建立一个指向新COM组件的索引 $word = new COM("word.applicatio ...

  2. 网狐6603 cocos2dx 棋牌、捕鱼、休闲类游戏《李逵捕鱼》手机端完整源码分析及分享

    该资源说明: cocos2d 棋牌.捕鱼.休闲类游戏<李逵捕鱼>手机端完整源码,网狐6603配套手机版源码,可以选桌子,适合新手学习参考,小编已亲测试,绝对完整可编译手机端,下载后将文件考 ...

  3. python类方法与对象方法学习

    class Test_Demo: TEST = 'test_value' def __init__(self,name,age): self.name = name self.age = age #s ...

  4. SQL语句优化技术分析

    一.操作符优化 1.IN 操作符 用IN写出来的SQL的优点是比较容易写及清晰易懂,这比较适合现代软件开发的风格.但是用IN的SQL性能总是比较低的,从Oracle执行的步骤来分析用IN的SQL与不用 ...

  5. Unity 3D中的菜单项

    1.File菜单:主要是包含项目和场景的创建.保存以及输出等功能.2.Edit(编辑)菜单:只要包括对场景进行一系列的编辑以及环境设置操作等命令.3.Assets(资源)菜单:掌握资源在Unity中的 ...

  6. QuickReport多页打印

    You use composite reports for this(TQrCompositeReport) on the quickreports tabTake a look in the Dem ...

  7. HP的笔记本经常蓝屏崩溃 -------athr.sys

    因为windows 7才新装不久,没有时间下载配置什么符号表,直接临时下载了WinDbg分析下Dump文件, Probably caused by : athr.sys ( athr+428a5 ) ...

  8. 如何使用git创建项目,创建分支

    git config -global user.name "Your name" git config -global user.email "you@example.c ...

  9. SQL SERVER 系统存储过程

    Transact-SQL中的存储过程,非常类似于Java语言中的方法,它可以重复调用.当存储过程执行一次后,可以将语句缓存中,这样下次执行的时候直接使用缓存中的语句.这样就可以提高存储过程的性能. Ø ...

  10. 模仿TMALL搜索,下拉提示 优化 用户keypress停顿200毫秒间隔时,在执行异步取数据操作 通过underscore的函数debounce来实现