MySQL tables do not show up in the phpMyAdmin and MySQLWorkbench
-
16-10-2019 - |
Question
I just setup the phpMyAdmin and I have this problem: When I login, I can't see any tables.
I had tried this with MySQLWorkbench and I got the same result.
Any suggestions ?
Solution
Running these commands are completely synonymous:
SHOW TABLES;
SELECT table_name FROM information_schema.tables where table_schema = DATABASE();
Under the hood, both of these commands will only check for the presence of .frm files in the currently selected database.
In MySQLWorkbench, you must make sure you have a Default Schema selected. Otherwise, you should not get anything back. Here is what effectively happens from the mysql client's point-of-view:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.5.12-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select database();
+------------+
| database() |
+------------+
| NULL |
+------------+
1 row in set (0.00 sec)
mysql> show tables;
ERROR 1046 (3D000): No database selected
mysql> SELECT table_name FROM information_schema.tables where table_schema = DATABASE();
Empty set (0.00 sec)
mysql>
Try the following in MySQLWorkbench:
- In the main window under 'Server Administration' (to the right), click 'Manage Server Instances'
- In the 'Server Instances' ListBox on the Left, Select a Server Instance
- Click the 'Edit Selected...' Button
- In the Parameters Tab, the last Edit Field is Labeled 'Default Schema:'
- Make sure you put a Database Name in that Field. For test purposes, use 'information_schema' (preferable) or 'mysql'.
After these steps, the selected database should be visible.
Give it a Try !!!
OTHER TIPS
The account that you are using to log into PHPmyAdmin/Workbench may not have permissions on the required tables. Do you see the required tables when you use the same login in the MySQL monitor console? Try logging in with a higher privileged account and viewing again.