When executing hive – f script com.mysql.jdbc . exceptions.jdbc4 .CommunicationsException: Communications link failure

cd $HIVE_ HOME/bin
vi hive- site.xml
The reason for the error is hive- site.xml The configuration in is incomplete or the configuration item is wrong

<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/opt/software/hadoop/hive110/warehouse</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.56.130:3306/hive110?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
 <value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
 <value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
 <value>root</value>
</property>
</configuration>

In particular, we should pay attention to whether the IP address in the IP address configuration item is correct

<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.56.130:3306/hive110?createDatabaseIfNotExist=true</value>

Read More: