org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.

来源:互联网 发布:java 获取日期 编辑:程序博客网 时间:2024/06/05 16:32

schematool -dbType mysql -initSchema

I set Hive hadoop on CentOS of VMware of Mac. And I set Mysql on Mac. When I use ‘schematool -dbType mysql -initSchema’ command I got error blow.

Then I checked my hive-site.xml

<property>    <name>javax.jdo.option.ConnectionPassword</name>    <value>Root@123</value>    <description>password to use against metastore database</description>  </property>  <property>    <name>javax.jdo.option.ConnectionUserName</name>    <value>root</value>    <description>Username to use against metastore database</description>  </property>  <property>    <name>javax.jdo.option.ConnectionURL</name>    <value>jdbc:mysql://192.168.168.1:3306/hive6</value>  </property>  <property>    <name>javax.jdo.option.ConnectionDriverName</name>    <value>com.mysql.jdbc.Driver</value>    <description>Driver class name for a JDBC metastore</description>  </property>

On the Mysql server, I did the flush privileges below:

mysql> GRANT ALL PRIVILEGES ON *.* TO  'root'@'%' IDENTIFIED BY 'Root@123'; Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)

Still got same Error..

At last I found the reason because I installed Mysql with Homebrew.

If you installed MySQL from brew it really does only listen on the local interface by default. To fix that you need to edit /usr/local/etc/my.cnf and change the bind-address from 127.0.0.1 to *.

Then run brew services restart mysql.

阅读全文
0 0