Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mysql_pconnect


DnJ

Recommended Posts

I have oscommerce working flawlessly on my local machine but when I uploaded my files to the server I receive this warning:

 

Warning: mysql_pconnect(): Access denied for user: xxxx@localhost' (Using password: YES) in xxxx/xxxxpublic_html/includes/functions/database.php on line 17

Unable to connect to database server!

 

I have tried setting persistent connections to false.

 

Line 17 of database.php calls the pconnect function

 

if (USE_PCONNECT == 'true') {
     $$link = mysql_pconnect($server, $username, $password);
   } else {
     $$link = mysql_connect($server, $username, $password);

 

Any ideas would be great, thanks.

 

Doug

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

is the database information in the two configure.php files correct for the server or is that information still set for your local machine.

 

did you reconfigure the two configure.php files to reflect the paths and database information for the server instead of your local machine

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

is the database information in the two configure.php files correct for the server or is that information still set for your local machine.

 

did you reconfigure the two configure.php files to reflect the paths and database information for the server instead of your local machine

 

Yes both the catalog and admin /includes/configure.php have been changed to reflect the server settings.

 

Thanks for the reply

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

when you say that you tried setting the pconnect to false I take it that you did this in the configure.php files and not the database.php

 

The error message usually appears if any one part of the database information in the configure.php files is wrong includes case sensitivity

 

do you get this message in both catalog and admin

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve,

 

Good point thanks for a fresh thought.

 

Will go and check and make sure that both are set correctly.

 

I know that /catalog/includes/configure.php is right

 

but

 

/catalog/admin/includes/configure.php maybe be set wrong but I think I did test both and got the same error.

 

Be back with an update in a few.

 

Thanks again.

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

Admin side settings:

 

  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'xxx_xxx');
 define('DB_SERVER_PASSWORD', 'xxx_xxx');
 define('DB_DATABASE', 'xxx_xxxxxxx');
 define('USE_PCONNECT', 'true'); // use persisstent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

 

 

 

Catalog side settings:

 

  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'xxx_xxx');
 define('DB_SERVER_PASSWORD', 'xxx_xxx');
 define('DB_DATABASE', 'xxx_xxxxxxx');
 define('USE_PCONNECT', 'true'); // use persistent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

 

localhost is the setting as per my isp

 

I think when I tested it set to false that I only changed the catalog side to false but not setting the admin side to false as well shouldn't affect the catalog side accessing the database hopefully??

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

yes set

define('USE_PCONNECT', 'true');

to

define('USE_PCONNECT', 'false');

in both files as for the database.php do not change the code there from true to false otherwise you will reverse the check making false true and true false

 

Now with the datadase.php file set at true and both configure.php files set to false try to connect and see what your error message is.

 

If you still get the same message and you are absolutely sure that the information in both configure.php files are the same and correct then contact your host as the server for mysql may need to be restarted.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve,

 

Thanks a lot for the help.

 

When I change persistent connection to false it throws the same error but bypass the if statement and goes to the else statement and refers to line 19 of database.php

 

Warning: mysql_connect(): Access denied for user: 'dnj_dnj@localhost' (Using password: YES) in /public_html/includes/functions/database.php on line 19

Unable to connect to database server!

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

that is a different warning note the first warning was pconnect this one is connect

 

define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'dnj_dnj');
define('DB_SERVER_PASSWORD', 'xxx_xxx');
define('DB_DATABASE', 'xxx_xxxxxxx');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');

this is saying that something is wrong with the database information

 

the first message has

xxxx/xxxxpublic_html/includes/functions/database.php on line 17

the second

/public_html/includes/functions/database.php on line 19

is this due to you editing the first message or did you have a path wrong

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve,

 

I edited the first message sorry should have edited the second as well for continutiy. I fixed the problem and have now moved on to a new issue.

 

Thanks for your help

 

When I created my database on my server it adds a concate value to both the username and database name so in keeping I added this value to the password as well and password has nothing concate associated with it.

"One Of Life's Greatest Pleasures Is Doing What Others Say You Can't"

Link to comment
Share on other sites

yes some have it set to place db on the end, well at least your fixed

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...