开发者

Imported tables are not showing up in phpmyadmin [closed]

This ques开发者_开发问答tion is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

I exported our production database and created a development database called test. Using ssh I imported the tables/data into the development database.

mysql -u root -p -h localhost test < data.sql

I can view the database structure and it returns rows as expected when I use the command line mysql. However, when I open up phpmyadmin, the "test" database is there but it has no tables and I can't select any of the data.

Any idea on how to fix this?


I had a similar problem with one database and I'd like to share with you a possible cause/solution:

I have imported a .sql file as you did and then I went to phpmyadmin, selected the database and surprise: No tables in the database, but I went to mysql command line and did a SHOW TABLES and they do exist.

So this is what happened in my case, the original database had some VIEWS defined by a user that did not exist in my computer's mysql users. Example:

CREATE ALGORITHM=UNDEFINED DEFINER=admin@% SQL SECURITY DEFINER VIEW cantidades AS select (...)

The user admin@% was available on the original server from where I've exported the database, but not on my computer.

So the fix to this solution was either to add that user, or to drop the views and create them again with a existing user.

I have choosen the second option: DROP VIEW cantidades; CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW cantidades AS select (...)

I've used root because that is the default user for my local XAMPP installation, but for security purposes I recommend using the same user you use to connect to that database.


  1. Check admin database user name for the database you selected to import
  2. Create a user with same name in the newly imported database through phpmyadmin.

Your problem will be fixed.


Sounds like the database user you are using to connect via phpmyadmin doesn't have permissions on the test database.


I don't know how but this has been fixed by my coworker. Thanks anyway. Turns out he changed where the database was...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜