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就这样了,困在这个地方整整一天了,求教!
telnet 192.168.1.148 3306
能连上吗?
可以
@Magina_learning: 通过hadoop用户名能连上mysql吗?
@dudu: 用mysql -u hadoop -p可以登录
@Magina_learning: 登录mysql用的也是192.168.1.148吗?
@dudu: 是的,mysql服务器,客户端,hive都在这一台主机上(master)
@Magina_learning: 可以参考stackoverflow上的这个回答一个一个检查一下
@dudu: 谢谢,解决了,其实就是mysql绑定localhost,远程访问不了(昨晚电脑不在旁边,自以为能,不好意思啊),大神一针见血。