"John P . Looney" wrote:
> It's now giving a decent error...though it's not the error I was
> expecting.
>
> ==> httpd/error_log <==
> [Tue Feb 6 16:01:23 2001] [debug] mod_midgard.c(1178): [client 172.24.1.104]
>midgard_translate_handler(latin1, http://midgard.sunnydale.antefacto.com:80/asgard)
> [Tue Feb 6 16:01:23 2001] [debug]
>/var/tmp/midgard-1.4/usr/include/mgd_apache.h(135): [client 172.24.1.104] Midgard:
>select_database opened midgard
> [Tue Feb 6 16:01:23 2001] [debug] mod_midgard.c(1221): [client 172.24.1.104]
>Midgard: host record for midgard.sunnydale.antefacto.com:80 not found
> [Tue Feb 6 16:01:23 2001] [error] [client 172.24.1.104] File does not exist:
>/var/www/midgard/html/asgard
There's a problem in midgard-lib which makes it not report a failure
when the connection to MySQL failed. It's fixed in CVS,
but could you check whether this is the problem in your case? I've
attached the patch that should fix the problem.
> Is there anyway to make midgard try to connect to a specific host, for the
> database ? There is nothing in the local mysql logs to suggest that it's
> connecting locally...it seems like it's opening a database...but not on this
> machine!
Are basic connections logged too? I suppose they are. The thing is,
midgard will always
connect to localhost, unless you've changed that in lib/src/defaults.h
Emile
===================================================================
RCS file: /usr/local/cvs/midgard/lib/src/midgard.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- midgard/lib/src/midgard.c 2001/02/06 12:49:49 1.3
+++ midgard/lib/src/midgard.c 2001/02/07 08:16:53 1.4
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.3 2001/02/06 12:49:49 emile Exp $
+/* $Id: midgard.c,v 1.4 2001/02/07 08:16:53 emile Exp $
*
* midgard-lib: database access for Midgard clients
*
@@ -128,6 +128,7 @@
midgard *mgd_connect(const char *database,
const char *username, const char *password)
{
+ int connected;
midgard *mgd = mgd_setup();
if (mgd == NULL)
@@ -141,18 +142,21 @@
if (!database)
database = MGD_MYSQL_DATABASE;
+
/* create mysql connection handle */
mgd->mysql = mysql_init(NULL);
- if (!mgd->mysql) {
+
+ /* connect to the database */
+ connected = mgd->mysql &&
+ mysql_real_connect(mgd->mysql, MGD_MYSQL_HOST,
+ username, password, database, 0, NULL, 0);
+
+ if (!mgd->mysql || !connected) {
mgd_free_pool(mgd->tmp);
mgd_free_pool(mgd->pool);
free(mgd);
return NULL;
}
-
- /* connect to sql server */
- mysql_real_connect(mgd->mysql, MGD_MYSQL_HOST,
- username, password, database, 0, NULL, 0);
return mgd;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]