hive使用mysql localstore方式连接Access denied for user 'hive'@'localhost' to database
2013-05-14 02:06
543 查看
mysql> create user 'hive' identified by 'hive';
--创建用户
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'hive@localhost' with grant option; --localhost不可少,否则启动bin/hive 后show databases后有异常,见“附注”
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> flush privileges; --这个不可少,不然启动bin/hive后不会立即生效(hivedb不会产生)
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hivedb |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec) --可以看到有hivedb生成。
mysql>
附注
异常如下:
hive> show databases;
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user
'hive'@'localhost' to database 'hivedb'
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user
'hive'@'localhost' to database 'hivedb'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
--创建用户
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'hive@localhost' with grant option; --localhost不可少,否则启动bin/hive 后show databases后有异常,见“附注”
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> flush privileges; --这个不可少,不然启动bin/hive后不会立即生效(hivedb不会产生)
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hivedb |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec) --可以看到有hivedb生成。
mysql>
附注
异常如下:
hive> show databases;
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user
'hive'@'localhost' to database 'hivedb'
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user
'hive'@'localhost' to database 'hivedb'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
相关文章推荐
- Ubuntu上使用jsp去连接mysql的时候踢提示Access denied for user 'root'@'localhost' (using password: YES)的解决办法!!!
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- mysql连接问题 ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using pas
- Toad for MySQL ,Navicat for MySQ连接错误 Access denied for user: 'root@localhost' (Using password: YES)
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- mysql压缩包如何使用及PoolableConnectionFactory 和Access denied for user 'testdb'@'localhost'问题的解决
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- mysql Access denied for user ''@'localhost' to database
- JSP连接MySQL时错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- Spring4.1使用c3p0加载配置文件连接数据库,Access denied for user 'root'@'localhost' 错误!
- jdbc与mysql的连接错误解决——“Connect failed: Access denied for user 'root'@'localhost' (using password: YES)”
- windows XP中,mysql连接时提示:1045 access denied for user 'root'@'localhost' using password yes 的解决方法
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO))
- Windows下mysql错误:ERROR 1045 (28000):Access denied for user 'root'@'localhost'
- mysql Access denied for user 'root'@'localhost' (using password: NO)解决办法
- mysql access denied for user'root'@'localhost' using password yes
- mysql两个错误:1067服务无法启动;1045 access denied for user 'root'@'localhost' using password yes
- ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法