Search code examples
mysqlvagranttalend

TALEND - Vagrant Mysql connexion issues


I'm pulling my hair over the following situation.

I'm unable to connect to my MySQL server in Vagrant (2.0.0 , OS: Ubuntu 16.04 ) with only specific applications (HeidiSQL and Talend 6.1). This error happens with Talend MySQL components with the mysql-connector-java-5.1.30 jar and Java 1.8 JRE.

I receive the following error each time when connecting either directly (TCP/IP) or over SSH (TCP/IP over SSH) to the MySQL Server with the aforementionned applications:

Access denied for user 'user'@'IP' (using password: YES)

This however doesn't happens with MysqlWorkbench with both direct connection (TCP/IP) or over SSH with the same user credentials. Below are the settings of the MySQL server:
MySQL Server Network Info Maria Db: 10.0.34 bind-address: 0.0.0.0 skip-name-resolve: true

The following have already been tried and tested:

  • Access credentials and privileges verification
  • DNS flush both on Guest and Host machines
  • Addition of MySQL server IP to host file
  • Verification of ports opening both on host and guest

Solution

  • The following solved the issue:

    GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%' WITH **GRANT OPTION**;
    

    The GRANT OPTION does the trick.

    Alternatively this could be caused by wrong driver being used in your Talend workspace. To update the MySQL connector JAR follow the steps below:

    1. Donwload the updated connector driver here
    2. Replace the 'tMySQLOutput/tMySQLInput' component(s) with an equivalent tJDBC ones
    3. Add the new connector JAR (No 2 on the image) and the class name com.mysql.jdbc.Driver (No 4 on the image) (ref https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-classpath.html)

    enter image description here