关于hive里安装mysql出现错误,如何删除指定的主机或用户?(解决Access denied)
前期博客
你可以按照我写的这篇博客去,按照hive的mysql。
1 复习ha相关 + weekend110的hive的元数据库mysql方式安装配置(完全正确配法)(CentOS版本)(包含卸载系统自带的MySQL)
出现如下问题
ERROR 1045 (28000): Access denied for user 'hive'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'hive'@'master' (using password: YES)
ERROR 1045 (28000): Access denied for user 'hive'@'%' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'master' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
最后要达到这个目的(才可以解决问题!!!)
进入root用户
mysql> select user,host,password from mysql.user;
mysql> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | master | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| hive | localhost | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| hive | master | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| root | % | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+-----------+-------------------------------------------+
关键是hive用户下的这三个配置出来就好, hive@% hive@master hive@localhost
我的这里,是root对各个主机下密码都是root。hive对各个主机密码都是hive。
或者
mysql> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | djt11 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| hive | localhost | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| hive | djt11 | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
| root | % | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+-----------+-------------------------------------------+
rows in set (0.00 sec)
关键是hive用户下的这三个配置出来就好, hive@% hive@master hive@localhost
我的这里,是root对各个主机下密码都是root。hive对各个主机密码都是hive。
怎么来解决问题?
进入root用户,执行
[root@master native]# mysql -uroot -p
Enter password:(默认是回车)
MySQL> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host,user from user;
+-----------+------+
| host | user |
+-----------+------+
| % | Hive |
| % | root |
| 127.0.0.1 | root |
| localhost | |
| localhost | root |
| master | |
| master | root |
+-----------+------+
7 rows in set (0.00 sec)
mysql> delete from user where user=' ';
Query OK, 2 rows affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from user;
+-----------+------+
| host | user |
+-----------+------+
| % | hive |
| % | root |
| 127.0.0.1 | root |
| localhost | root |
| master | root |
+-----------+------+
5 rows in set (0.00 sec)
mysql> delete from user where host='127.0.0.1';
Query OK, 1 row affected (0.00 sec)
mysql> delete from user where host='localhost';
Query OK, 1 row affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from user;
+--------+------+
| host | user |
+--------+------+
| % | hive |
| % | root |
| master | root |
+--------+------+
3 rows in set (0.00 sec)
mysql> delete from user where user='hive';
Query OK, 1 row affected (0.00 sec)
mysql> select host,user from user;
+--------+------+
| host | user |
+--------+------+
| % | root |
| master | root |
+--------+------+
2 rows in set (0.00 sec)
mysql> grant all privileges on hive.* to hive@'%' identified by 'hive' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from user;
+--------+------+
| host | user |
+--------+------+
| % | hive |
| % | root |
| master | root |
+--------+------+
3 rows in set (0.00 sec)
mysql> grant all privileges on hive.* to hive@'master' identified by 'hive' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from user;
+--------+------+
| host | user |
+--------+------+
| % | hive |
| % | root |
| master | hive |
| master | root |
+--------+------+
4 rows in set (0.00 sec)
mysql> grant all privileges on hive.* to hive@'localhost' identified by 'hive' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from user;
+--------+------+
| host | user |
+--------+------+
| % | hive |
| % | root |
| master | hive |
| master | root |
| master | localhost|
进入root用户查看database的效果
[root@master native]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.1.61 Source distribution
Copyright (c) 2000, 2011, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hive |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
进入hive用户查看database的效果
[root@master native]# mysql -uhive -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.61 Source distribution
Copyright (c) 2000, 2011, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hive |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> use hive;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql>
同时,大家可以关注我的个人博客:
http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/ http://www.cnblogs.com/sunnyDream/
详情请见:http://www.cnblogs.com/zlslch/p/7473861.html
人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获
对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071)
关于hive里安装mysql出现错误,如何删除指定的主机或用户?(解决Access denied)的更多相关文章
- mac系统中搭建apache+mysql+php的开发环境,安装mysql后,登录报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
php新手在mac系统中搭建apache+mysql+php的开发环境(按照这篇博客来操作的:http://my.oschina.net/joanfen/blog/171109?fromerr=xvC ...
- 60分钟内从零起步驾驭Hive实战学习笔记(Ubuntu里安装mysql)
本博文的主要内容是: 1. Hive本质解析 2. Hive安装实战 3. 使用Hive操作搜索引擎数据实战 SparkSQL前身是Shark,Shark强烈依赖于Hive.Spark原来没有做SQL ...
- APT 安装 MySQL 提示错误:dpkg: error: dpkg frontend lock is locked by another process
在安装 MySQL 的时候提示错误: ubuntu@VM-0-6-ubuntu:/opt$ sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb dpkg: e ...
- docker - 容器里安装mysql
在docker中安装mysql ubuntu官方镜像是精简的ubuntu系统,很多软件和库没有安装,所以直接安装mysql的话依赖较多,建议直接从源码编译安装mysql 通过命令行安装 先启动一个容器 ...
- 有关 安装MySQL的错误
1.登录SQLyog 密码与MySQL设置不一致. 2.上一次安装MySQL没有卸载干净,(排查删除: (1)搜索C盘删除相关文件(隐藏目录 C:\ProgramData 下寻找 mysql ) ...
- centos6 rpm安装mysql(5.5版本)包括 error : Failed dependencies:libaio的解决办法.
1.先在/opt目录下放了两个rpm包 2.先看系统中是否有其他版本的mysql的rpm包 rpm -qa | grep -i mysql 命令结果如下图: 如果没有此步跳过,否则执行一下命令将其删除 ...
- Docker 安装mysql容器数据卷挂载到宿主机
环境 Centos:7 Docker: 17.05-ce Mysql: 5.7 1. Mysql外部数据和配置文件路径 msyql配置文件路径:/etc/mysql mysql数据卷路径:/var/l ...
- Mysql - 解决Access denied for user ''@'localhost' to database 'mysql'问题
http://361324767.blog.163.com/blog/static/11490252520124454042468/ 首先我想说一句话: 我极度鄙视国内搞IT的人,简直无语,同样是解决 ...
- mysql忘记root密码或报错:ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘xx‘
有的时候忘记了root密码或其他用户的密码,登录的时候报错:ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ' ...
随机推荐
- JS--处理重复元素
1.Js找出在数组中出现过的元素,即删除重复元素最后只留一个 <script> function findEleOnly(arr){ for(var i=arr.length-1;i> ...
- Ubuntu源配置
一.图形界面配置 新手推荐使用图形界面配置: 系统工具 -> 软件和更新-> Ubuntu软件-> 下载自:-> 其他站点 点击 选择最佳服务器(将通过连接测试确定最佳镜像) ...
- BZOJ一句话
一句话题解集合. 1061: [Noi2008]志愿者招募 单纯形,运用对偶原理转化过来,变成标准形然后单纯性裸上即可. #include<cmath> #include<cstdi ...
- 【Django】路由系统
目录 URLconf配置 正则表达式详解 分组命名匹配 命名URL 与 URL反向解析 @ *** Django 1.1版本 URLConf官方文档 URL配置(URLconf)就像Django所支撑 ...
- cogs 49. 跳马问题
49. 跳马问题 ★ 输入文件:horse.in 输出文件:horse.out 简单对比时间限制:1 s 内存限制:128 MB [问题描述] 有一只中国象棋中的 “ 马 ” ,在半张 ...
- Android底层驱动开发(一)
1 Android为什么要增加硬件抽象层HAL A 统一硬件调用接口.所以利用HAL屏蔽linux驱动的复杂不统一的接口 B 解决GPL版权问题,因为linux内核基于GPL协议.这个G ...
- 绕过open_basedir读文件脚本
绕过open_basedir读文件脚本 2016年11月13日 01:28:21 阅读数:1221 参加了一场2016年的sycsec感觉又学到不少东西 废话不多说,首先啥是open_basedir? ...
- vue (v-if show 问题)
vue中的显示和隐藏有两种方式 1.v-if ( 相当于动态创建的标签,在html 结构中,是不存在的. ) 2. v-show(控制的是 html 的css display:none 属性.结 ...
- 转 EL表达式
EL表达式 一.EL表达式简介 EL 全名为Expression Language.EL主要作用: 1.获取数据 EL表达式主要用于替换JSP页面中的脚本表达式,以从各种类型的web域 中检索java ...
- POJ 1279 Art Gallery 半平面交/多边形求核
http://poj.org/problem?id=1279 顺时针给你一个多边形...求能看到所有点的面积...用半平面对所有边取交即可,模版题 这里的半平面交是O(n^2)的算法...比较逗比.. ...