Jump to content

Problem with MySql Connection


rayudu

Recommended Posts

Hi Friends,

 

              i am new one to this.i have a big problem i think i will get the correct solution...

              when i am connecting to the MySql Database i am getting this.

 

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/txtimg0/public_html/cherple/Scheduled_Campaigns.php  on line 24 unable to select database

 

define("prod_dbuser","xxxx");  //gtmdev1

 

define("prod_dbpass","xxxxx");  //gtmdev1

 

define("prod_database_cm2","cm2");

 

define("prod_database_glue","glue");

 

define("prod_hostname","xxxxxxxx");

 

i am defined these constants in gtm

_constants.php i am includeing this file when ever i need to connect with database.

 

this working fine in past.now we installed the new Database from then i am getting this error.

 

can any one Please me Help to Resolve this Issue.?

and why php is not connecting to the database???

 

 

Thanks,

Ramky

 

 

 

 

       

 

 

 

Link to comment
Share on other sites

Hi Friends,

 

              i am new one to this.i have a big problem i think i will get the correct solution...

              when i am connecting to the MySql Database i am getting this.

 

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/txtimg0/public_html/cherple/Scheduled_Campaigns.php  on line 24 unable to select database

 

define("prod_dbuser","xxxx");  //gtmdev1

 

define("prod_dbpass","xxxxx");  //gtmdev1

 

define("prod_database_cm2","cm2");

 

define("prod_database_glue","glue");

 

define("prod_hostname","xxxxxxxx");

 

i am defined these constants in gtm

_constants.php i am includeing this file when ever i need to connect with database.

 

this working fine in past.now we installed the new Database from then i am getting this error.

 

can any one Please me Help to Resolve this Issue.?

and why php is not connecting to the database???

 

 

Thanks,

Ramky

 

 

 

 

       

 

 

 

That looks unfamiliar to me, try this

mysql_connect("localhost", "mysql_user", "mysql_password") or
    die("Could not connect: " . mysql_error());
mysql_select_db("cm2");

Try if this works first, I am not sure if you can connect to both databases at the same time. :/

Ted

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.