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

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值