|
Author |
Message |
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Sat May 17, 2003 9:46 pm (21 years, 7 months ago) |
|
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?
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 |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun May 18, 2003 7:47 am (21 years, 7 months ago) |
|
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"... |
________________________________
|
|
|
|
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Sun May 18, 2003 9:05 am (21 years, 7 months ago) |
|
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.......... |
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Sun May 18, 2003 9:59 am (21 years, 7 months ago) |
|
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... |
|
|
|
|
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Sun May 18, 2003 10:34 am (21 years, 7 months ago) |
|
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.
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 |
|
|
|
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Sun May 18, 2003 12:16 pm (21 years, 7 months ago) |
|
UPDATE:
My website now works.
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 |
|
|
|
|
|
|
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.140533 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |