问题
I failed to connect to MySQL from google data fusion
the step:
First, I add the connector https://dev.mysql.com/downloads/file/?id=462850
Second, I try to add a connection (failed)
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
回答1:
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:
- SSH to the mysql box and run netstat -tln and confirm if the port where mysql is running on is 3306
- 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
- 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
回答2:
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
来源:https://stackoverflow.com/questions/56835022/failed-to-connect-with-mysql-using-google-data-fusion