Troubleshooting admin MySQL connection problem [message #158867] |
Mon, 06 April 2009 20:27 |
3jane
Messages: 9 Registered: April 2009 Location: The Great Northwest
Karma: 0
|
Junior Member |
|
|
Greetings,
I'm hoping someone can help me solve a problem I'm having with FUDforum.
When I try to access the admin section it gives me this error: | Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cambrian_admin'@'localhost' (using password: YES) in /home/cambrian/FUDforum/include/theme/default/db.inc on line 17
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/cambrian/FUDforum/include/theme/default/db.inc on line 17
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/cambrian/FUDforum/include/theme/default/db.inc on line 17
Fatal error: SQL Error has occurred, please contact the administrator of the forum and have them review the forum's SQL query log in /home/cambrian/FUDforum/include/core.inc on line 189
|
The non-admin section of the forum is working perfectly, so it's obviously connecting to the database without a problem. It's my understanding that both sections, admin and non-admin, use the GLOBALS.php (in the includes directory), which contains the variables for the MySQL login.
The admin problem began relatively recently; it was working perfectly before that. I'm not sure if it has anything to do with it, but the hosting provider upgraded the server and changed some paths to my FUDforum installation in the process, so I had to change the paths in GLOBALS.php accordingly. I can't remember if I used the admin after that, but I believe so.
I'm assuming it's a database connection problem, as I said.
Here's line 17 of /home/cambrian/FUDforum/include/theme/default/db.inc: | $conn = $connect_func($GLOBALS['DBHOST'], $GLOBALS['DBHOST_USER'], $GLOB
ALS['DBHOST_PASSWORD']) or die (fud_sql_error_handler("Initiating $connect_func", mysql_error(fud_sql_lnk), mysql_errno(fud_sql_lnk), "Unknown"));
|
FUDforum sure didn't like the diagnostic code I tried to stick in db.inc to see what was in the variables, so I'm not sure how to go about troubleshooting. As I said, since the admin and forum both use the database connection vars in GLOBALS.php I don't have an explanation that doesn't involve the supernatural.
Here are some system details:
FUDforum 2.7.3
MySQL 5.0.75
PHP 5.2.9
Linux
Any help would be much appreciated.
|
|
|
|
|
|
|
|
|
|
Re: Troubleshooting admin MySQL connection problem [message #159091 is a reply to message #158905] |
Mon, 04 May 2009 01:46 |
3jane
Messages: 9 Registered: April 2009 Location: The Great Northwest
Karma: 0
|
Junior Member |
|
|
Quoting naudefj's link above:
Ilia wrote on Mon, 07 July 2003 08:48 | Yeah there is.
<?php
include "GLOBALS.php";
fud_use('db.inc');
fud_use('compiler.inc', true);
compile_all(theme, lang, name);
?>
The (theme, lang, name) variables correspond to data inside the themes table.
|
From which FUDforum directory should the above script be executed? Also, is it executed from the command line as the posts preceding it seem to indicate, and if so, how can that be possible given that this particular PHP installation is compiled into Apache? Kinda confused here.
|
|
|
|
|
|
|
|
Re: Troubleshooting admin MySQL connection problem [message #159114 is a reply to message #159110] |
Tue, 05 May 2009 20:41 |
3jane
Messages: 9 Registered: April 2009 Location: The Great Northwest
Karma: 0
|
Junior Member |
|
|
Okay, I used:
compile_all('default', 'english', 'default');
(BTW, the original code I copied didn't use quotes around the parameters). I didn't see any errors when it executed, so I assume it worked, as far as rebuilding the default theme. However, when I tried the admin panel afterward:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cambrian_admin'@'localhost' (using password: YES) in /home3/cambrian/FUDforum/include/theme/default/db.inc on line 17
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home3/cambrian/FUDforum/include/theme/default/db.inc on line 17
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home3/cambrian/FUDforum/include/theme/default/db.inc on line 17
Fatal error: SQL Error has occurred, please contact the administrator of the forum and have them review the forum's SQL query log in /home3/cambrian/FUDforum/include/core.inc on line 189
Interestingly, I can connect to the database from the command line using the MySQL login info from GLOBALS.php with no problem. I've checked all the paths and symlinks and they all seem to be correct. Is there some way I can troubleshoot FUDforum's database connection mechanism, perhaps by inserting some PHP code or using standalone code?
Your generous assistance is greatly appreciated.
[Updated on: Tue, 05 May 2009 20:42] Report message to a moderator
|
|
|
|