Getting mysql_set_charset() error

I am seeing the following error on multiple pages of my admin including the add new post admin, the add new page admin, the plugins tab, and the permalinks settings page and other random admin pages at other times.

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in /home/impactib/public_html/wp-includes/wp-db.php on line 541

I even attempted a fresh install of Wordpress before installing any plugins, and tried to add multi-db first. Still came up with the same message.

Any help. This is really frustrating.

  • DavidM
    • DEV MAN’s Mascot

    Hi mwgaston,

    Could you let us know where it is you're seeing that error message? Have you already gone through the installation for Multi-DB? Did this error occur after that install?

    I found the following thread where that specific error was mentioned.

    Could you have a look at some of the things mentioned by the developer (Barry) toward the bottom of that thread in regard to the error?


  • mwgaston
    • New Recruit

    This error message appears most consistently at the top of the 'add new post' and 'add new page' inside the Wordpress admin, and occasionally on the plugins and themes pages in the admin.

    I have read and re-read the post referenced, but it seems to be of no help.

    Here are the steps that I took.

    1. I had a multisite set up with all plugins activated and running smoothly.
    2. I then went painstakingly through the steps for installing the multi-db plugins.
    3. The error started showing up twice at the top of all pages including the front side of the site and subsites.
    4. I completely unistalled wordrpess, reinstalled it, configured it for multisite, and attempted to reinstall multi-db again closely following the directions.
    5. The error no longer shows up on the front of the sites/subsites, but is still showing up on the admin pages referenced above.

    Any ideas?

  • Barry
    • DEV MAN’s Mascot

    I'll take a close look, but it suggests that your install is dropping it's connection to your mysql server at some point. Have you had any other issues showing? Slowness of site? etc..

    The error started showing up twice at the top of all pages including the front side of the site and subsites.

    It's a warning not an error, you should ideally have warnings and notifications switched off on your php install if you are running a production server. Errors should, of course, be displayed.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.