One Star

Cannot establish db connection: "Connection refused"

Hello,
I'm trying to establish a connection to a mysql5 database (Metadata, right click on a db), but i always get a 
"The driver has not received any packets from the server." ... "Connection refused".
My connection string is the following: jdbc:mysql://localhost:3306/mydb?noDatetimeStringSync=true (I'm using localhost as the server on my local machine, looks like it's not going to work..).
Do you have any suggestion ..? Thanks Smiley Happy
10 REPLIES
Moderator

Re: Cannot establish db connection: "Connection refused"

Hi,
Is there anything OK with your network? Can you connect to your MySql DB successfully by using client without Talend tool?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Cannot establish db connection: "Connection refused"

Hi,
Thank you for your answer!
I don't have mysql on my machine, I haven't installed it, do I need it installed for Talend to work?
Same thing when I try to use the ETL connection component for Oracle (tOracleConnection_1), it tells me that "the Network Adapter could not establish the connection".. Looks like it won't work no matter witch DB connection component I try to use..
Do you have an idea?
Moderator

Re: Cannot establish db connection: "Connection refused"

Hi,
I haven't installed it, do I need it installed for Talend to work?

You don't need to install it for Talend. We just want to know if your network and DB connection are OK with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Cannot establish db connection: "Connection refused"

Ok, well I have Mamp on (with apache and mysql), so I can access localhost on a web page, so I guess it's ok..
As for the db connection, I don't know how I can test it..
Since I installed Mamp and ran it, the error is slightly different, the driver still haven't received any packets from the server, but this time it's a timout exception "Read timed out".. 
Thank you in advance for your time
Moderator

Re: Cannot establish db connection: "Connection refused"

Hi,

You can try to change your timeout on your MySql DB.
There should be my.ini file under Mysql DB Installation Path. Add
wait_timeout=(set value xxxx)

interactive_timeout=(set value xxxx)

Let us know if it is OK with you.
Best regardsa
Sabrina
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Cannot establish db connection: "Connection refused"

Hi,
I don't have any my.ini file since I don't have any mysql db.. Mamp is using mysql, but the folder mysql of Mamp doesn't have a .ini file.
Must I have a mamp running if I want to use Talend's db connection ?
Sorry I'm a little bit lost, first time using Talend and the demo project isn't working because of that..
Thanks again in advance for your time 
One Star

Re: Cannot establish db connection: "Connection refused"

I'm running map on the port 80, so when I try the same port number with a Talend db connection, it will wait, I think it's because the port is already used by map so it's waiting for the port to be free.
The error is the same, connection refused, can I use the default port 3306 ?
One Star

Re: Cannot establish db connection: "Connection refused"

I had the same problem too, when you configure your db, login=root, pwd=root, server=localhost, port=3306, db=MySql (this one worked for me, don't ask me why^^), additional parameters: instance=Training (found that one on a forum)
Moderator

Re: Cannot establish db connection: "Connection refused"

Hi Snakegz
If it works when you use "Instance" in your DB connection paramater?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Cannot establish db connection: "Connection refused"

Hi All,
Can any1 solve my query.
i want to read 80 million record from mysql and write into mysql.
But after 20 million reads it gave me could not create connection error.
.
.
2016-06-10 03:07:25;aAtDjY;kC202j;kC202j;BIOWISE_ETL_JOB;BW_Dbnsfp_SNP_Job_0;Default;6;Java Exception;tMysqlInput_1;com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Could not create connection to database server. Attempted reconnect 3 times. Giving up.;1
can any1 ll provide solution for this?
Regards,
Anand Yadav