Mustafa
Supreme Deity
In Training
Lifetime member
Lifetime Member Likes (0)
Hi,
I checked error logs and I found this
PHP Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in /sitepath/wp-includes/wp-db.php on line 554
Probably this about multi-db? Any idea?
Thanks.

Responses (20)
Support Chimp (joined March 2010) Likes (0)
Hey there.
Last time I saw that error a fresh set of files did the trick:
http://premium.wpmudev.org/forums/topic/error-messages-from-wp-after-installing-multi-db
And a similar one here:
http://premium.wpmudev.org/forums/topic/oh-what-have-i-done-this-time
Does a fresh set resolve anything?
Take care.
Lifetime Member (joined February 2011) Likes (0)
Hi Tim, yes I try to set up and the previous warnings fixed, but I'm getting this message since edit it.
Anyway, I'm looking for solution. If I can fix it, I'll write here.
Support Chimp (joined March 2010) Likes (0)
I'll ask Barry as well to see if he has any further pointers which might help.
Thanks.
Developer (joined June 2008) Likes (0)
Usually get this if there is something amiss with the db-config.php - if you want to pop it up I can take a look - remember to mask / change any usernames / passwords
Lifetime Member (joined February 2011) Likes (0)
I've read your post http://premium.wpmudev.org/forums/topic/oh-what-have-i-done-this-time#post-254338 and made some changes.
I just checked error-logs and get this.
Developer (joined June 2008) Likes (0)
That means that you haven't added the server your running on as a dc (the 3 numbers of the IP address you've put in your add_dc_ip doesn't correlate with the current servers IP address).
The lhost line suggests you have some empty strings where there should be ip address in your add_db_server lines.
Lifetime Member (joined February 2011) Likes (0)
but our database server in the same dc? and I defined 3 numbers of ip as a dc.
I've used this tool ( http://premium.wpmudev.org/db-tools/db_servers.php ) for create db servers value, I don't think so.
Can I send smilar copy of our db-config file via contact form?
Developer (joined June 2008) Likes (0)
email it to barry at incsub dot com and it'll come direct - let me know the ip address of your webserver and db-server (if they're the same then just let me know the one).
Lifetime Member (joined February 2011) Likes (0)
I sent mail. Thanks for helping, really appreciated.
Support Chimp (joined March 2010) Likes (0)
Hey guys.
Just checking in. Is this one sorted now?
Thanks.
Lifetime Member (joined February 2011) Likes (0)
Nope, still getting this warning.
Support Chimp (joined March 2010) Likes (0)
I'll ping Barry again to see he checked into what you sent.
Thanks.
People Person (joined February 2012) Likes (0)
Sorry for the delay!
WPMUDEV-ian (joined November 2011) Likes (0)
Hiya,
Just posting to let you know that we have not forgotten you on this issue.
Apologies for the extreme long wait. I am going to followup on this and will keep you posted.
Cheers
PC
Support Kangaroo (joined March 2011) Likes (0)
Greetings Mustafa,
Just chiming in since I found this ticket in the back and I do a lot of multi db installs.
For that item please try putting in just the first three octets of the IP i.e. xxx.xxx.xxx.
However, I checked two of my running flawlessly installs of Multi DB and use this:
add_dc_ip('localhost', 'dc1');Please advise.
Cheers, Joe
Member (joined November 2012) Likes (0)
We hope you were able to resolve this. Since this thread has been inactive for some time I am going to go ahead and close the ticket. If you were unable to resolve it or have any further questions, please feel free to re-open the ticket – we are more than happy to help!
Member (joined March 2008) Likes (0)
Hi, I get the same warning.
PHP Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /sitepathwp-content/db.php on line 287I think this is besause the
define( 'DATACENTER', $dc );is inside in a if statement (line 106 -110), which doesn't get true and so the DATACENTER is not defined.I think there should be a define for DATACENTER right on top of the db.php like the global functions but I'm not sure that the correct value should be.
define( 'DATACENTER', false);ordefine( 'DATACENTER', null);Can you inform the plugin developer to guide us about it?
Thanks in advance
Lena
Developer (joined June 2008) Likes (0)
You need to add a add_dc_ip with the IP setting for the IP address where your webserver is, this will then pass the IF statement you have mentioned and the define will be set.
Member (joined August 2011) Likes (0)
Awesome! I was having the same error and I had put all 4 octets in the dc ip address instead of 3 octets. Now all is fine.
Support Kangaroo (joined March 2011) Likes (0)
Greetings everyone and thank you Barry for your input as well.
It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.
If it wasn't resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)
Thank you for being a WPMU Dev Community Member!
Cheers, Joe
Become a member