Search code examples
mysqlhadoopgoogle-cloud-platformhivegoogle-cloud-dataproc

How to access mysql inside MasterNode of the dataproc cluster?


Couldn't access mysql inside the namenode of the DataProc cluster.

********@cluster-***-m:/etc/hive/conf$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)**

Solution

  • The reason for this might be that the mysql is used by the Hive for storing the metadata for the HDFS locations.

    The user/password details for the "hive" user can be found under /etc/hive/conf/hive-site.xml under

      <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>hive</value>
      </property>
    ..
      <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>hive-password</value>
      </property>
    

    you can use,

    mysql -u hive -p hive-password

    this seems to be the default for the "hive" user with limited grants, as for the root or primary users I have no clue.