Database visible via mysql CLI but not MOD_PHP with same username
| From: | Elliot Mackenzie | Date: | Tue, 15 Feb 2005 21:22:37 +0000 |
| Subject: | Database visible via mysql CLI but not MOD_PHP with same username | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38589@lists.php.net to get a copy of this message | ||
I have encountered a "hidden database" issue with mod_php, apache2 and
mySQL that I have thus far been unable to resolve.
I am able to connect to the mysql socket using mysql_connect, but then
find that mysql_list_dbs only returns the "test" database. This
*sounded* like an issue with the SHOW DATABASES privilege until I found
I was able to log in to the same MySQL server *as the same user* with
the provided command-line client (mysql) and SHOW DATABASES would
display all the other databases on this system.
Furthermore, I tried connecting as root, and again found only the "test"
database was visible to PHP. If I dropped the test database, no
databases were visible to PHP (regardless of how many databases were
visible using SHOW DATABASES). If I created "test", "tester",
"testing", "hello" etc, then the "test" database would reappear to
PHP,
but no other databases were visible.
I also tried to connect PHP to MySQL as a super-user, and encountered
the exact same issue.
Any advice appreciated,
M.