WordPress.org

Ready to get started?Download WordPress

Forums

Disabled BP, re-enabled BP, now wp-admin shows slew of MySQL errors! (9 posts)

  1. farmer paul
    Member
    Posted 3 years ago #

    Hi there,

    We have a multi-site WordPress 3.0.1 installation with BP 1.2.5.2 installed. I have posted this issue to the BP forums, but I think it may be Multisite-related based on what I've read online.

    Today I just accidentally clicked “Network Deactivate” for the BuddyPress plugin, when I meant to deactivate a different one. Realizing my mistake, I immediately clicked “Network Activate” again for BuddyPress, and wp-admin came back with a page filled with a slew of these errors:

    Warning: mysql_real_escape_string(): 8 is not a valid MySQL-Link resource in /home/wmaster/yexpress.net/wp-includes/wp-db.php on line 785
    Warning: mysql_real_escape_string(): 8 is not a valid MySQL-Link resource in /home/wmaster/yexpress.net/wp-includes/wp-db.php on line 785
    Warning: mysql_real_escape_string(): 8 is not a valid MySQL-Link resource in /home/wmaster/yexpress.net/wp-includes/wp-db.php on line 785

    The WP Admin side was basically unusable because it was just crammed with the above errors. So in my panic so as not to halt our team’s development I changed the offending function in WP core so that PHP warnings would be suppressed:

    function _real_escape( $string ) {
    	if ( $this->dbh && $this->real_escape ) {
    		$orig_level = error_reporting();
    		error_reporting(E_ALL ^ E_WARNING);
    		$result = mysql_real_escape_string( $string, $this->dbh );
    		error_reporting($orig_level);
    		return $result;
    	}
    	else
    		return addslashes( $string );
    }

    At least now wp-admin is somewhat usable, though there are still a handful of similar MySQL errors still appearing in the header of every wp-admin page request:

    Warning: mysql_error(): 8 is not a valid MySQL-Link resource in /home/wmaster/yexpress.net/wp-includes/wp-db.php on line 922

    Another serious problem I noticed is that the “admin” account I’ve been using, which is supposed to be a Multisite Super-Admin, has lost a lot of its rights - and this is why I think this problem is Multisite-related. For instance, I can’t administer the global users table, or modify the available plugins to activate for sub-sites. Does anyone here know how to grant Super-Admin rights to a user, without access to the Super-Admin user management screens?

    Any help would be so appreciated! I’m a bit panicky because my other developers need to be able to use wp-admin regularly.

    Thanks.

  2. Network deactivating buddy press won't do that. I've done it a few times and it doesn't kill your site like that.

    What other plugins are you running? Smetimes the interdependencies get hung up. You might need tot turn them ALL off and back on, one at a time, to sort it out.

  3. farmer paul
    Member
    Posted 3 years ago #

    Thanks for your reply. I'd love to try that, but my admin account no longer has permission to turn off network-wide plugins, nor the other things I mentioned above. I probably have to edit the database manually, right? Any idea where I should look?

  4. Nah, just rename the plugins folder via FTP to plugins-old and all your plugins will be disabled :)

  5. farmer paul
    Member
    Posted 3 years ago #

    Good call. I did that and all the active plugins were automatically deactivated. Also, my super-admin rights magically came back! Odd. And the errors cleared up.

    So then I reactivated BuddyPress, and those doggone errors are back! I haven't enabled any other plugins.

    It's almost as if something happened during the action of deactivating BP and reactivating that one time that caused some weird stuff to happen to the database (maybe due to plugin dependencies??), and now the whole thing is fscked. It's just a total mystery to me as to what those changes were... Cripes.

  6. farmer paul
    Member
    Posted 3 years ago #

    Well.. if anything comes to you, let me know! I'm not going to get all tied up in knots about this now. We have another instance of the site that I might try to mirror if I can't figure it out. So long as we have super-admin rights again, I think we're okay, even if the interface is cluttered with PHP warnings.

  7. You didn't upgrade anything, did you? And you're still using your buddypress enabled theme, right?

  8. farmer paul
    Member
    Posted 3 years ago #

    No, no upgrades, default theme. Someone else suggested I run a MySQL repair, so I'm trying that now.

  9. You're on the latest version of WordPress, but not the latest of buddypress which is 1.2.6.

Topic Closed

This topic has been closed to new replies.

About this Topic