首页 新闻 会员 周边

hive启动出问题

0
悬赏园豆:100 [已解决问题] 解决于 2017-12-20 11:12

Nested Throwables StackTrace:
java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://192.168.1.148:3306/hive?createDatabaseIfNotExist=true, username = hadoop. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

。。。

Hadoop装好了,没问题,mysql也装了,也没出现问题,装了hive后在命令行输入hive就这样了,困在这个地方整整一天了,求教!

Magina_learning的主页 Magina_learning | 初学一级 | 园豆:61
提问于:2017-12-19 20:36
< >
分享
最佳答案
1

telnet 192.168.1.148 3306能连上吗?

收获园豆:100
dudu | 高人七级 |园豆:30880 | 2017-12-19 21:02

可以

Magina_learning | 园豆:61 (初学一级) | 2017-12-19 21:05

@Magina_learning: 通过hadoop用户名能连上mysql吗?

dudu | 园豆:30880 (高人七级) | 2017-12-19 21:13

@dudu: 用mysql -u hadoop -p可以登录

Magina_learning | 园豆:61 (初学一级) | 2017-12-19 21:17

@Magina_learning: 登录mysql用的也是192.168.1.148吗?

dudu | 园豆:30880 (高人七级) | 2017-12-19 21:20

@dudu: 是的,mysql服务器,客户端,hive都在这一台主机上(master)

Magina_learning | 园豆:61 (初学一级) | 2017-12-19 21:22

@Magina_learning: 可以参考stackoverflow上的这个回答一个一个检查一下

dudu | 园豆:30880 (高人七级) | 2017-12-19 22:31

@dudu: 谢谢,解决了,其实就是mysql绑定localhost,远程访问不了(昨晚电脑不在旁边,自以为能,不好意思啊),大神一针见血。

Magina_learning | 园豆:61 (初学一级) | 2017-12-20 11:11
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册