4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 MySQL connection issues on UnitedHosting
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Sat May 17, 2003 9:46 pm (20 years, 11 months ago) Reply with QuoteBack to Top

Hi,

This is for you UH users!

I just signed up with UH and am moving all me bits over but I'm stuck on something; connecting to a MySQL dbase.

My domain is: justdvdreviews.com, so the default dbase that's been setup is called, justdvdreviews_com. I've created a dbase to use under this, using Ensim and imported the .sql file. It's called dvdreview

With me so far? Wink


The index.php is generating the following error:

Quote:
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/conn.php on line 8
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)



The file, conn.php, contains the dbase connection info that I use to connect:

Code:
<?php
# Type="MYSQL"
# HTTP="true"
$hostname_connDVDReview = "localhost";
$database_connDVDReview = "dvdreview";
$username_connDVDReview = "username";
$password_connDVDReview = "password";
$connDVDReview = mysql_pconnect($hostname_connDVDReview, $username_connDVDReview, $password_connDVDReview) or die(mysql_error());
?>




This script works fine on my old host (34SP) as is so I've not touched it (except for username/password). It also works on my apache server at home. But it's not working at UH and I'm puzzled. I've changed the dbase name to justdvdreviews_com_-_dvdreview but I still get the same error.

I've raised a ticket with UH but so far no joy. Anyone out there been here before?

Any light shedding is much appreciated!

Cheers!

Anil


Last edited by GunstarHero on Sun May 18, 2003 5:58 pm, edited 1 time in total
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 18, 2003 7:47 am (20 years, 11 months ago) Reply with QuoteBack to Top

This is just a guess, but try replacing "mysql_pconnect" with "mysql_connect" (pconnect is a permanent MySQL connection which might not work on all hosts).

By the way, isn't "dvdreview" a table name? When you're asked for the database name, I think you should keep "justdvdreviews_com"... Confused

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Sun May 18, 2003 9:05 am (20 years, 11 months ago) Reply with QuoteBack to Top

Thanks for the reply Daniel.

I have tried the changes you suggested, and I'm pretty sure I've been through every iteration of possible solutions on the connection script!

Still doesn't work though.

Someone on the UH forum suggested making a change to the Ensim CP security level. I'm going to try this, once I find it, and I'll post back my findings. Ensim just seems to be so slow..........
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 18, 2003 9:59 am (20 years, 11 months ago) Reply with QuoteBack to Top

Use this :

Quote:
<?php
# Type="MYSQL"
# HTTP="true"
$hostname_connDVDReview = "localhost";
$database_connDVDReview = "justdvdreviews_com";
$username_connDVDReview = "username";
$password_connDVDReview = "password";
$connDVDReview = mysql_connect($hostname_connDVDReview, $username_connDVDReview, $password_connDVDReview) or die(mysql_error());
?>


Will have a look in ensim to see where the security level is, have been upgraded to the latest ensim these last few days though, so it may take a few days to iron out the bugs. Got a feeling it might be in the reseller control panel though, not sure...
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Sun May 18, 2003 10:34 am (20 years, 11 months ago) Reply with QuoteBack to Top

Hi Justin, thanks for your reply.

I tried your code but I get the same response:

Quote:
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/conn.php on line 8

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/conn.php on line 8
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)



I know the script works! Just not on UH yet. Rolling Eyes

I have a feeling this is the security level but can I find where this is? Nope, not yet. I haven't been able to find it in any of the Ensim documentation yet either. I left a msg on UH boards so I'm sure someone's already been there/done that.

Here's hoping!


Last edited by GunstarHero on Sun May 18, 2003 5:58 pm, edited 1 time in total
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Sun May 18, 2003 12:16 pm (20 years, 11 months ago) Reply with QuoteBack to Top

UPDATE:

My website now works. Very Happy

The problem was a security issue as it was set too high. Now it's set to 'normal' and everything functions. Only resellers and above can make this change so UH changed it for me at my request.

And the only change I made to my original connection script was the dbase name which is now: justdvdreviews_com_-_dvdreview

Thanks for all your input, it's appreciated!

Anil
http://www.JustDVDReviews.com
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.123612 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme