3

I failed to connect to MySQL from google data fusion

the step:

  1. First, I add the connector https://dev.mysql.com/downloads/file/?id=462850

  2. Second, I try to add a connection (failed)

screenshot of the MySQL: screenshot of the mySQL

Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

**** Edit **** I think this is associated with allowing data fusion to access to our production data my second question is: How can I know what is the Google Data Fusion IP address?

if someone can help me that will be wonderful

thank you

hanane
  • 63
  • 5

2 Answers2

3

This error indicates that Cloud Data Fusion is unable to connect to mysql via JDBC with the given credentials (Host/port/User). You will need to ensure that the user provided can connect from any host. To trouble shoot this further, please do the following:

  1. SSH to the mysql box and run netstat -tln and confirm if the port where mysql is running on is 3306
  2. Login to mysql using Mysql CLI or a workbench tool and run the following SHOW DATABASES to list all the Databases in mysql and see if the one you are accessing is present
  3. Ensure that the user that is accessing mysql from Data Fusion can access from any hosts by running SHOW GRANTS FOR 'username'@'%'

Here are some additional articles that might help with troubleshooting. https://serverfault.com/questions/89955/unable-to-connect-to-mysql-through-jdbc-connector-through-tomcat-or-externally

Sree
  • 714
  • 4
  • 8
  • Thanks , I think this is associated with allowing data fusion to access to our database my second question is: How can I know what is the Google Data Fusion IP address? – hanane Jul 01 '19 at 15:57
  • Data Fusion instance runs in a tenant project and the pipelines run on dataproc clusters which are by default created when the pipelines run. Couple of options a. Run the pipelines on a pre-configured dataproc clusters here are instructions to do so https://stackoverflow.com/questions/56873909/how-do-i-configure-cloud-data-fusion-pipeline-to-run-against-existing-hadoop-clu/56874182#56874182 . b. Grant permissions in DB for the user to connect from any host by using "%" for hostname – Sree Jul 03 '19 at 16:26
  • 1
    thanks , i try with a user who have access from any host %” but i failed (same error) did i miss something ? – hanane Jul 04 '19 at 08:13
  • I'm having the exact error/issue trying to connect to a mysql database hosted on aws. user can connect from any host. did you figure out a fix in the end @hanane? – crazy8 Jan 02 '20 at 01:06
  • Unfortunately no @crazy8 – hanane Apr 09 '20 at 19:15
1

Even if you try to access via public IP it'll not work. I had the same issue. Because you have to enable VPC peering between the Datafusion tenant project id with your VPC.

Detailed steps are here: https://cloud.google.com/data-fusion/docs/how-to/create-private-ip

TheDataGuy
  • 2,712
  • 6
  • 37
  • 89