Search code examples
mysqlhadoophbasehivederby

Hive integration with mysql


i already installed Hive with hadoop over Hbase, i changed the configuration of database driver from derby to MySQL, but i got this exception

 FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user 'DBAUSER'@'linux-96' (using password: YES)

NestedThrowables:

 java.sql.SQLException: Access denied for user 'DBAUSER'@'linux-96' (using password: YES)
 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

i already installed MySQL on localhost and configured hive-site.xml to read from this db

i don't know where is the problem, could anyone help?


Solution

  • This is question is mostly related to your MySQL configuration.

    I bet that the problem is in your jdbc URL configuration. The error says is trying to connect to host linux-96 and you mentioned you have installed your MySQL server in your localhost.

    First run MySQL server in your localhost and try to open a client session:

    $ sudo service mysqld start
    $ mysql -h localhost -u root -p
    

    You should be able to login (if not search for how to reset MySQL root password)

    Create your destination database in MySQL and a user and a password and check you can log in by command line before going ahead.

    $ mysql -h localhost -u <user> -p<password> <database>
    

    Then check you hive-site.xml configuration. You should have something like this:

    <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://localhost:3306/database?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>user</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>password</value>
    </property>