I am trying to establishing a connection to jdbc:mysql://mysqldb:3306/zomato but it is not working.
I tried 2 differents approach:
at first, I did not want to use Strigo so I was not limited to the 8 hours. So I run my engines in containers within my local machine. The engines are running fine on the Control Hub and I can create and run some pipelines. However, I would like to use the connection cited in one of the lab with mysqldb and zomato. I am not sure how to “install” the zomato db and reviews table locally? I have a container running mysql but from there i dont know what to.
If i try to create the connection using my local engine, i get then the below error.
JDBC_00 - Cannot connect to specified database: com.mysql.cj.jdbc.exceptions.CommunicationsException: 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.
I could see a post with the same error message but it does not give the solution on how to get the zomato db and reviews table installed locally?
then I tried to create my engines in Strigo, even if it s not what I would like as an environment. When I then create a connection using the Strigo engine i get the below error message
Please note that i uploaded the mysql jar file as external source for all my engines.
Can you please help?
thank you
Best answer by Russ Webb
Hello Melanie,
I created the following instructions to install the ‘zomato’ and all the other databases:
onto a new mysql container I create on my MAC M1.
Install mysqldb as a container locally on my pc:
% docker pull arm64v8/mysql
create a mysql account for root/StreamTra1ningSets! in the mysqldb container on my pc:
% docker run --name mysqldb -e MYSQL_ROOT_PASSWORD=StreamTra1ningSets! -d arm64v8/mysql:latest
It is not at all the same error msg so does not solve my issue,
Also as mentioned in my previous message, I could see a post with the same error message but it does not give the solution on how to get the zomato db and reviews table installed locally?
@Russ Webb Thank you for your message, it is very detailed and i would never have known how to do all of it 😂
I am currently blocked at step 6 : scp ubuntu@<public ip - get from ‘machine info’ on strigo env - cog icon>:/tmp/alldatabases.sql .
Indeed I run the cmd with the public ip of my strigo env and I get the below error msg:
scp ubuntu@54.71.34.231:/tmp/alldatabases.sql . The authenticity of host '54.71.34.231 (54.71.34.231)' can't be established. ECDSA key fingerprint is SHA256:DA5oGdh5kfOtDURWzjP0ziFrtKWpdZ25NFHcugTPD3s. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '54.71.34.231' (ECDSA) to the list of known hosts. scp: /tmp/alldatabases.sql: No such file or directory
Below is what i have in the /tmp folder of Strigo, so no sql file there.
I also searched for a filename containing database but does not think the alldatabase.sql file is there
Did the academy change the path of the sql file? Did you run the above steps recently in your environment?
@Russ Webb we are def getting there haha. I gave permissions to my folder and indeed that was the issue.
I believe now we have a more problematic issue, the zomato db does not seem to exist … so i wont be able to do the labs for the certifications. See below all the dbs included . It looks very differently to yours :( any idea how i can get the zomato db?
@Russ Webb thanks, how do i get onto the 4.x environment? I connected again to Strigo but i can see the sql file is still containing the 3.x databases. ty
@Russ Webb my 2 sdc containers and my sqldb container was all in the network bridge so I thought it would be the same than creating another network.
But I did it anyway as you mentioned, now they are all 3 in another network and my SQL connection works! I don’t understand what is different between the bridge network and the melanie network since when I inpected the brigde one, i could see the 3 of them. But in any case, now it finally works yeahhh!!
Thank you very much for all your help and responsiveness!
Differences between user-defined bridges and the default bridge
User-defined bridges provide automatic DNS resolution between containers.
Containers on the default bridge network can only access each other by IP addresses, unless you use the --link option, which is considered legacy. On a user-defined bridge network, containers can resolve each other by name or alias.
so I reckon I’d have to use the ip address 172.18.0.2 rather than mysqldb (in your JDBC connection) although I’ve not tried that.
I tried all the steps above to get the databases inside the mysqldb container from Strigo environment to a container in my machine. Here, is the result I got at the end
As, you can see the Zomato database that I need is not present. In order to understand what is wrong, after doing the steps 3 and 4 I checked the size of alldatabases.sql and it looks like it is empty in the strigo environment. I also tried to get into the mysqldb container in the Strigo environment, but I got access denied. I am in the 4x environment. Can you help me find out the problem?
I am not sure why it was showing me an empty file even in the Strigo environment before, but now everything is good. I redid everything, and successfully transferred all the databases into my local container.