Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unknown MySQL Server Host 'http'


mcbsolutions

Recommended Posts

Hi everyone,

I'm sure this is simple, but I'm throwing my hands up in the air after testing various options and searching for an answer on the forum. I don't know if it's me but the search function on this forum does not seem to be giving accurate results. For example, it will often say no results found when I search for words that I know exist in the forums. Anyway...

 

I am running Foxserv on an XP machine to do all my development and testing.

 

I'm somehow not connecting to the mysql db i have setup. I have checked includesconfigure.php and my ini file for mysql and all seems ok.

 

 

When I load http://localhost/catalog/default.php the error I get is

Warning: Unknown MySQL Server Host 'http' (0) in C:FoxServwwwcatalogincludesfunctionsdatabase.php on line 19

 

Warning: MySQL Connection Failed: Unknown MySQL Server Host 'http' (0) in C:FoxServwwwcatalogincludesfunctionsdatabase.php on line 19

Unable to connect to database server!

 

I managed to mess something up somewhere along the line. Thanks for any assistance folks!!!

:)

Link to comment
Share on other sites

What do you have defined as your database server in your configure.php file?

 

It should be localhost.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Thanks for the replies, Daemonj and Broadway.

 

Well I made some progress. I setup a virtual host which i've defined as www.site.home, which I can pull up in my browser without the prior error, but still there is no db connection.

 

I'll post my files and see if you all can figure out what's wrong.

 

This is catalogincludesconfigure.php

<?php

/*

 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/



// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

 define('HTTP_SERVER', 'http://www.site.home/catalog'); // eg, http://localhost - should not be empty for productive servers

 define('HTTPS_SERVER', 'https://www.site.home/catalog'); // eg, https://localhost - should not be empty for productive servers

 define('ENABLE_SSL', false); // secure webserver for checkout procedure?

 define('DIR_WS_CATALOG', '/'); // absolute path required // DGM Added: note this was just a '/'

 define('DIR_WS_IMAGES', 'images/');

 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

 define('DIR_WS_INCLUDES', 'includes/');

 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');



 define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');

 define('DIR_FS_DOCUMENT_ROOT', 'd:/websites/site/catalog/');

 define('DIR_FS_CATALOG', 'd:/websites/site/catalog/');

 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');



// define our database connection

 define('DB_SERVER', '127.0.0.2'); // eg, localhost - should not be empty for productive servers

 define('DB_SERVER_USERNAME', 'root');

 define('DB_SERVER_PASSWORD', '');

 define('DB_DATABASE', 'osc');

 define('USE_PCONNECT', 'false'); // use persistent connections?

 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

?>

 

This is bits and pieces of httpd.conf

 

ServerRoot "C:FoxServApache"

ServerAdmin steve@localhost

ServerName localhost:80

DocumentRoot "d:websitessitecatalog"

<Directory "d:websitessitecatalog">

UserDir "My Documents/My Website"

<VirtualHost 127.0.0.2> 

   ServerAdmin [email protected] 

   DocumentRoot d:/websites/site/catalog 

   DirectoryIndex index.php default.php index.fire index.html index.htm default.html default.htm 

   ServerName www.site.home

   ErrorLog logs/www.site.home-error_log

   ScriptAlias /cgi-bin/ d:/websites/site/catalog/cgi-bin 

</VirtualHost>

 

This is my hosts file

 

127.0.0.1       localhost

127.0.0.2     www.site.home

 

This is my.ini file

 

#This File was made using the WinMySQLAdmin 1.3 Tool

#5/26/2003 1:43:16 AM



#Uncomment or Add only the keys that you know how works.

#Read the MySQL Manual for instructions



[mysqld]

basedir=C:/FoxServ/mysql

#bind-address=127.0.0.2

datadir=C:/FoxServ/mysql/data

#language=C:/FoxServ/mysql/share/your language directory

#slow query log#=

#tmpdir#=

#port=3306

#set-variable=key_buffer=16M

[WinMySQLadmin]

Server=C:/FoxServ/mysql/bin/mysqld-nt.exe

user=root	

password=

QueryInterval=10

 

I hope this is all the information you need. If there is something I missed, please let me know.

 

Thanks much!!

:D

 

Steve

Link to comment
Share on other sites

Open a command prompt, change to your mysql/bin directory and execute:

mysqladmin -u root version status proc

What are the settings for Connection and TCP Port?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Try to use the WORD "localhost" for the mysql connection instead of the 127.0.0.1 IP address, does that make a change?

 

I never use the localhost IP addresss in settings (except for loopback to localhost) but always assign another address in my hosts file (ie 192.168.100.10)

 

But then again I mainly work on *nix

 

HTH

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Try to use the WORD "localhost" for the mysql connection instead of the 127.0.0.1 IP address, does that make a change?

 

I never use the localhost IP addresss in settings (except for loopback to localhost) but always assign another address in my hosts file (ie 192.168.100.10)

 

But then again I mainly work on *nix

Why do you use an IP address other than 127.0.0.1?

 

It's okay. Not everyone can run a Windows box. :lol:

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I'm aware localhost is 127.0.0.1 :)

Just realized I always do because I never run stuff on Windows boxes but other servers in the lan. Makes no sense whasoever, ignore me.

 

Off to kill myself now :D

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Open a command prompt, change to your mysql/bin directory and execute:

Code:

mysqladmin -u root version status proc

 

Think we are getting somewhere. I got this:

 

connect to server at 'localhost" failed

error: 'access denied for user: 'root@localhost' (using password: No)'

Link to comment
Share on other sites

I'm aware localhost is 127.0.0.1 :)

I figured that much Mattice. :lol:

 

Just realized I always do because I never run stuff on Windows boxes but other servers in the lan. Makes no sense whasoever, ignore me.

I just did not know if you had a security reason or something else for not running as localhost. Such was the reason for my question.

 

Off to kill myself now :D

Oh, don't be so harsh.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Open a command prompt, change to your mysql/bin directory and execute:

Code:

mysqladmin -u root version status proc

 

Think we are getting somewhere. I got this:

 

connect to server at 'localhost" failed

error: 'access denied for user: 'root@localhost' (using password: No)'

Okay, did you assign a password to the root user? If so add a -p[password] to that command.

 

Did you happen to remove the root user? If so, replace the -u root with -u [username] -p[password].

 

Check your WinAdmin and see what username and password it is using to monitor the mysql server.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Okay, did you assign a password to the root user? If so add a -p[password] to that command.

 

To be honest, i have no idea. I had to reinstall foxserv after i installed osc..and thats where my problems started. i think i'm just using root with no password for the time being. When I go live..i know how to assign users and passwords to the db in my cpanel, but I don't understand how to do this offline. doesn't the file my.ini dictate this? sorry im completely lost.

 

Did you happen to remove the root user? If so, replace the -u root with -u [username] -p[password].

 

tried this...i got

Enter password:

 

Whatever i type I get the same error above.

 

Check your WinAdmin and see what username and password it is using to monitor the mysql server.

 

I don't know where to look! I'm using winmysqladmin v 1.3. i'm looking at my.ini setup file which i posted. Is this the right place to look?

Wish i knew what I was doing here.

 

Thanks!

Link to comment
Share on other sites

According to your WinMySQLAdmin .ini file, it is using the root user without a password which is part of why this is so perplexing.

 

Try this, at a command prompt in the mysql/bin folder execute:

mysql -u root

Do you get into mysql or do you get an error?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I do not have any idea why you are not working. If Foxserv has a discussion board for MySQL problems, I would suggest posting there.

 

Otherwise, you might want to consider uninstalling MySQL, rebooting, and reinstalling paying attention to any mention of a servername, username and password.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...