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

*爱你&永不变心* 提交于 2019-12-11 04:19:43

问题


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.


回答1:


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.




回答2:


The problem is with Definer if you have any view in the database.

Just drop the Views and it should work, or you can open the exported database file in Notepad and change Definer to root.




回答3:


Just to help someone else, in the phpMyAdmin, in config.inc.php, change this:

$cfg['Servers'][$i]['extension'] = '**mysqli**';

to this:

$cfg['Servers'][$i]['extension'] = '**mysql**';


来源:https://stackoverflow.com/questions/9877814/phpmyadmin-doesnt-show-table-list-for-database-that-definitely-has-tables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!