phpMyAdmin doesn't show table list for database that definitely has tables

12,857

I was having a similar problem. Through some digging I found that phpMyAdmin's table list was failing on this query:

SHOW TABLE STATUS FROM `database`;

And this was the error message:

ERROR 1143 (42000): SELECT command denied to user ''@'localhost'
 for column `column` in table `table`

Which led me to this SO question: mysql forgets who is logged in: command denied to user ''@'%'

Which led me to the conclusion that one of the views that I loaded into the database has privileges that are conflicting. Indeed, when I looked at the SQL dump I was loading the database from, I found the culprit:

CREATE ALGORITHM=UNDEFINED DEFINER=`someotheruser`@`localhost` ..

Where someotheruser did not exist in my local MySQL. I changed it to the following:

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` ..

And reloaded the view, and everything is now working properly.

Share:
12,857
Peter L
Author by

Peter L

Updated on November 21, 2022

Comments

  • Peter L
    Peter L over 1 year

    I have a website, written in php, using a MySQL database. After buying a new laptop (Windows 7), I downloaded WAMP 2.2, with MySQL 5.5.20, PHP 5.3.10 and phpMyAdmin 3.4.10.1. I exported the whole database from the live website and imported it into my wamp environment, using MySQL console.

    phpMyAdmin lists the database, but says there are no tables in it. Yet, the websites workss within the WAMP environment. Further, if I perform an SQL "SHOW TABLES" within phpMyAdmin, it displays the tables.

    I'm completely puzzled as to why these tables aren't listed in the leftmost column of phpMyAdmin.

    • bfavaretto
      bfavaretto about 12 years
      Caching issue maybe? Did you clear the browser cache?
  • Fabrizio
    Fabrizio about 10 years
    Don't, you want to use the mysqli, a lot faster and more reliable
  • sifr_dot_in
    sifr_dot_in almost 3 years
    if "UNDEFINED" is considered as root, what about security vulnerability?
  • sifr_dot_in
    sifr_dot_in almost 3 years
    if we define root as user instead of specific user, what about security vulnerability?