ubuntu上mysql和hive_Ubuntu系统下安装并配置hive-2.1.0

说在前面的话

默认情况下,Hive元数据保存在内嵌的Derby数据库中,只能允许一个会话连接,只适合简单的测试。实际生产环境中不使用,为了支持多用户会话,

则需要一个独立的元数据库,使用MySQL作为元数据库,Hive内部对MySQL提供了很好的支持。

在Ubuntu系统下安装并配置hive详细正确步骤如下!

一、mysql-server和mysql-client的下载

root@SparkSingleNode:/usr/local#  sudo apt-get install mysql-server  mysql-client (Ubuntu版本)

516084ae19b1fecb2d2dace77d8945a2.png

我这里,root密码,为rootroot。

二、启动MySQL服务

bf1737ee88358dcc4f2dc8dd4c48531b.png

root@SparkSingleNode:/usr/local# sudo /etc/init.d/mysql start      (Ubuntu版本)

* Starting MySQL database server mysqld [ OK ]

root@SparkSingleNode:/usr/local#

附加说明,

sudo /etc/init.d/mysql restart  这是重启

sudo /etc/init.d/mysql stop 这是停止

三、进入mysql服务

Ubuntu里 的mysql里有个好处,直接自己对root@下的所有,自己默认设置好了

af86999279289c4cb62334d5d342782f.png

36192f52f2d4b6a642af96e5b919cfe9.png

root@SparkSingleNode:/usr/local# mysql -uroot -p

Enter password:   //输入rootroot

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 43

Server version: 5.5.53-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2016, 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> CREATE USER  'hive'@'%'  IDENTIFIED BY 'hive';

mysql>GRANT ALL PRIVILEGES ON  *.* TO 'hive'@'%' WITH GRANT OPTION;

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> use hive;

Database changed

mysql> select user,host,password from mysql.user;

+------------------+-----------------+-------------------------------------------+

| user | host | password |

+------------------+-----------------+-------------------------------------------+

| root | localhost | *6C362347EBEAA7DF44F6D34884615A35095E80EB |

| root | sparksinglenode | *6C362347

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值