[CentOS] wordpess can't connect to DB but mediawiki can

Sat Aug 15 22:12:53 UTC 2015
Richard <lists-centos at listmail.innovate.net>

> Date: Saturday, August 15, 2015 17:57:03 -0400
> From: Tim Dunphy <bluethundr at gmail.com>

>> 
>> [this isn't really a centos issue, even if you're using centos,
>> which isn't obvious. that said ...]
> 
> 
> Yeah that's true. But this list tends to be rather helpful for
> general problems that are less specific to centos. Sometimes. :)
> Really seems to depend...
> 
> Incidentally I am using centos on all hosts:
> 
># cat /etc/redhat-release
> CentOS Linux release 7.0.1406 (Core)
> 
> OK now that that's out of the way, for some reason I don't seem to
> have an entry in my db database for either jokefire or jfwiki:
> 
> MariaDB [mysql]> select * from db  where Db like 'jfwiki' or Db
> like 'jokefire';
> Empty set (0.00 sec)
> 
> Not sure why that would be the case. They're definitely there on
> this database server:
> 
> MariaDB [mysql]> show databases;
> +--------------------+
>| Database           |
> +--------------------+
>| bacula             |
>| information_schema |
>| jfwiki             |
>| jokefire           |
>| mysql              |
>| performance_schema |
> +--------------------+
> 6 rows in set (0.00 sec)
> 
> Any other ideas?
> 
> Thanks,
> Tim
> 
> On Sat, Aug 15, 2015 at 3:07 PM, Richard wrote:
> 
>> 
>> 
>> > Date: Saturday, August 15, 2015 13:53:28 -0400
>> > From: Tim Dunphy <bluethundr at gmail.com>
>> > 
>> > Hey guys,
>> > 
>> > I'm running both a wordpress site as well as a mediawiki off of
>> > the same web servers. The mediawiki site works great! The
>> > wordpress site, meh. Not so much. I keep getting the common
>> > database connection error:
>> > 
>> > Error establishing a database connection
>> > 
>> > And as far as I can tell the settings between the mediawiki site
>> > and the wordpress site are nearly identical.
>> 
>>   < ... snip ... >
>> 
>> [this isn't really a centos issue, even if you're using centos,
>> which isn't obvious. that said ...]
>> 
>> I would start by looking at the access control entries for the wp
>> and mw dbs, (in the mysql.db table). Based on what you are trying
>> here, there should be matching entries in that table for the "Db"s
>> "jokefire" and "jfwiki" (e.g., for the Host as well as the various
>> _priv fields).
>> 
>>  select * from db where Db='jokefire' or Db='jfwiki' order by
>>  Host\g
>> 
>> There may be something else going on, but without knowing that the
>> access control is as it should be there's not much value in
>> speculating.
>> 

The mysql access control bits are in tables in the mysql db that's
in your list above. 

  +---------------------------+
  | Tables_in_mysql           |
  +---------------------------+
  | columns_priv              |
  | db                        |
  | event                     |
  | func                      |
      ...

"Use" that db and then issue:

 select * from db where Db='jfwiki' or Db='jokefire' order by Host;