Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MySQL hostname problem - unable to connect to server


adnet

Recommended Posts

Posted

I am not able to connect to MySQL database using the admin.

 

I am able to connect using the catalog.

 

The problem appears to be with the hostname or syntax I should be using for the admin section. Please verify what naming conventions I should be using for the database connection. My hosting company has already verified the HOSTNAME for the MySQL db.

 

ie: admin - application_top.php

 

// define our database connection

define('DB_SERVER', $HTTP_ENV_VARS['mysql.exotic-creations-by-dewdrop.com']);

define('DB_SERVER_USERNAME', 'exoti001');

define('DB_SERVER_PASSWORD', 'donna215');

define('DB_DATABASE', 'exoti001');

define('USE_PCONNECT', 1);

 

 

http://exotic-creations-by-dewdrop.com/adm...min/default.php

 

error: Unable to connect to database server!

 

I am using OS v 2.1

 

I did make the modifications to the application_top.php file(s) but did not

change the database.php because I did not see anthying to change.

 

The only modifications I made were for the database settings:

 

No coding changes were made.

 

I am using a UNIX FREE BSD server

:oops:

 

Please help me asap ....I need to get this problem fixed asap

Posted

What does your catalog/includes/configure.php look like for the DB_SERVER?

 

You should have pretty much the same thing on the admin side.

 

Also, shouldn't you be able to connect to your DB through the MySQL.exe client? That would be another way to test your parameters.

 

Good luck!

Posted

The DB_SERVER is - 'mysql.exotic-creations-by-dewdrop.com'

 

This is the correct HOSTNAME for the MySQL db. I also connect

using MySQLadmin with no problem. The username, password

and database name is also correct.

 

 

// define our database connection

define('DB_SERVER', 'mysql.exotic-creations-by-dewdrop.com');

define('DB_SERVER_USERNAME', 'exoti001');

define('DB_SERVER_PASSWORD', 'donna215');

define('DB_DATABASE', 'exoti001');

define('USE_PCONN

Posted
 define('DB_SERVER', $HTTP_ENV_VARS['mysql.exotic-creations-by-dewdrop.com']);

 

I think your problem is with the $HTTP_ENV_VARS[]. Take that away, and you should be OK.

Posted

Thank You

 

This resolved my problem.

 

What version of OS Commerce should I now use?

 

I am going to re-download the latest version.

Posted

Use 2.2's latest snapshot.

 

And actually instead of this...

 

define('DB_SERVER', 'mysql.exotic-creations-by-dewdrop.com');

 

Try this when yuo go to set it up again...

 

define('DB_SERVER', 'localhost');

 

That's worked for me on every MySQL dB that I've used on several different boxes with different setups.

Posted
define('DB_SERVER', 'localhost');

 

That's worked for me on every MySQL dB that I've used on several different boxes with different setups.

 

That will only work when the DB server is actually on the same box. Granted that's the setup for most sites.

Posted

After making these changes the admin layout is not displaying the

data properly

 

after changes

 

http://exotic-creations-by-dewdrop.com/adm...min/default.php

 

before changes

 

http://198.104.182.200/admin/default.php

 

'localhost' also did not work

 

again the only change that was made was the db settings, no other

coding changes has been made.

 

these examples are using 2 different servers. The only changes

were made to the application_top.php ( files )

 

 

Please send me your advice... :oops:

Posted

Looks fine to me. The only problem isn't the DB connection but the various titles...

Posted

Did you make those changes with a WYSIWYG editor like Dreamweaver or Frontpage? IF so, most likely that is the problem because HTML editors make slight changes in coding that will affect this. Everytime I've seen something like this, that was the problem.

 

Edit your code using a straight HTML editor like cuteHTML.

Posted

I made the changes using Notepad.

 

where can I get the editor you mentioned?

 

also localhost did not work. I am using a UNIX FREE BSD box.

Archived

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

×
×
  • Create New...