FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Troubleshooting admin MySQL connection problem
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Troubleshooting admin MySQL connection problem [message #158867] Mon, 06 April 2009 20:27 Go to next message
3jane is currently offline  3jane   United States
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 #158880 is a reply to message #158867] Wed, 08 April 2009 20:42 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
I'm still trying to ferret out the problem, but no joy so far.

From FUDforum/errors/sql_errors:

?621       ?1239216638?(/home3/cambrian/FUDforum/include/theme/default/db.inc:17<br />
/home3/cambrian/FUDforum/include/core.inc:69<br />
/home3/cambrian/FUDforum/include/adm.inc:18<br />
/home3/cambrian/FUDforum/include/core.inc:63<br />
/home3/cambrian/public_html/adm/admglobal.php:14<br />
) : <br />
Query: Initiating mysql_connect<br />
_GET: array (
  'S' =&gt; '8f29c989ba613d83b8bbc9594e3a8eb1',
  'SQ' =&gt; '98992f64c8ff209f7b144a9db3ae6863',
)<br />
Server Version: Unknown<br />
[Referring Page] hhhh://www.[domain].com/index.php?t=index&amp;S=8f29c989ba613d83b8bbc9594e3a8eb1&amp;SQ=30402a4997d69da47f1d79690f2fa18b&amp;<br />


Re: Troubleshooting admin MySQL connection problem [message #158887 is a reply to message #158867] Fri, 10 April 2009 23:17 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
I've checked everything seven ways from Sunday, but I can't seem to suss out the problem. It doesn't make sense; if the regular forum can connect to the database using the variables in GLOBALS.php then the admin should be able to as well. It's beginning to look more and more like the supernatural is involved. Perhaps an exorcism is in order?

Re: Troubleshooting admin MySQL connection problem [message #158888 is a reply to message #158867] Sat, 11 April 2009 16:26 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You may have different copies of the GLOBALS.php file. They should all be symlinks to the one in the "include" directory.
Re: Troubleshooting admin MySQL connection problem [message #158889 is a reply to message #158888] Sat, 11 April 2009 19:43 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
Thanks for the reply. The symlinks are all pointing to include/GLOBALS.php correctly; that was one of the first things I checked. The problem seems to be a subtle one, and very puzzling.

Re: Troubleshooting admin MySQL connection problem [message #158899 is a reply to message #158889] Mon, 13 April 2009 17:29 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Some of the include files are generated. Please rebuild all your themes and let us know if it helps or not.
Re: Troubleshooting admin MySQL connection problem [message #158904 is a reply to message #158899] Mon, 13 April 2009 19:18 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
Hmmm, is there a way to rebuild a theme from the command line? Remember, I don't have access to the admin control panel. I'm using the default theme, by the way.

Re: Troubleshooting admin MySQL connection problem [message #158905 is a reply to message #158904] Mon, 13 April 2009 19:32 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Yes, see http://fudforum.org/forum/index.php?t=msg&goto=11521
Re: Troubleshooting admin MySQL connection problem [message #159091 is a reply to message #158905] Mon, 04 May 2009 01:46 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
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(themelangname);
?>


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 #159092 is a reply to message #159091] Mon, 04 May 2009 05:40 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You can also copy the code into a .php file in your forum's "root" directory and run it from your browser.
Re: Troubleshooting admin MySQL connection problem [message #159104 is a reply to message #159092] Mon, 04 May 2009 20:37 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
Running the code from the DocumentRoot in my browser gets this error:

Warning: file_get_contents(/home3/cambrian/FUDforum/thm/default/i18n/lang/charset) [function.file-get-contents]: failed to open stream: No such file or directory in /home3/cambrian/FUDforum/include/compiler.inc on line 613
Missing Message entry custom_avatar_queue inside i18n/lang/msg

Is it possible to rebuild the theme from the command-line instead?

Re: Troubleshooting admin MySQL connection problem [message #159105 is a reply to message #159104] Mon, 04 May 2009 21:04 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You need to use it with your forum's theme values. For example:

// compile_all(theme, lang, name);
compile_all('default', 'english', 'default');
Re: Troubleshooting admin MySQL connection problem [message #159106 is a reply to message #159105] Mon, 04 May 2009 21:13 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
Messages: 9
Registered: April 2009
Location: The Great Northwest
Karma: 0
Junior Member
Here's the code using your most recent suggestion:

<?php
include "GLOBALS.php";
fud_use('db.inc');
fud_use('compiler.inc', true);
compile_all(default, english, default);
?>


And here's the new error:

Parse error: syntax error, unexpected T_DEFAULT, expecting ')' in /home3/cambrian/public_html/rebuild_theme.php on line 5


Re: Troubleshooting admin MySQL connection problem [message #159110 is a reply to message #159106] Tue, 05 May 2009 05:38 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Please add the quotes as shown in the example I've posted.
Re: Troubleshooting admin MySQL connection problem [message #159114 is a reply to message #159110] Tue, 05 May 2009 20:41 Go to previous messageGo to next message
3jane is currently offline  3jane   United States
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

Re: Troubleshooting admin MySQL connection problem [message #159122 is a reply to message #159114] Wed, 06 May 2009 18:22 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You can try to write a small PHP program to see if it can connect with your settings. If you cannot, you've confirmed that it's not a FUDforum problem. However, if you can, you should be able to retrofit the solution to FUDforum's settings/ scripts.

Best regards.

Frank
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to search in chinese
Next Topic: Privileges for paid-up members
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 12:57:35 GMT 2024

Total time taken to generate the page: 0.02393 seconds