简体   繁体   English

MySQL数据库显示在phpMyAdmin中,但不显示命令行客户端

[英]MySQL database shows in phpMyAdmin but not the command line client

I have installed MAMP and set it up with wordpress. 我已经安装了MAMP并使用wordpress进行了设置。 Everything is OK except that I have four databases under mysql through terminal. 一切正常,除了我通过终端在mysql下拥有四个数据库。 They are - information_schema,mysql,performance_schema, test 它们是-information_schema,mysql,performance_schema,测试

But when I enter phpmyadmin, it shows - information_schema,mysql,performance_schema, wordpress. 但是当我输入phpmyadmin时,它显示-information_schema,mysql,performance_schema,wordpress。

Under the actual wordpress db there are many tables, but under test there is no subfiles stored and it has no tables. 在实际的wordpress数据库下,有很多表,但是在测试中,没有存储任何子文件,也没有表。

What could be the problem? 可能是什么问题呢? Thanks! 谢谢!

So you see the database from within phpMyAdmin and want to know why you can't see it from the command line (terminal); 因此,您可以从phpMyAdmin中查看数据库,并想知道为什么无法从命令行(终端)中查看数据库; this appears to be because you're not connected as the same user. 这似乎是因为您没有以同一用户身份连接。 Even if you're connected as the same user name, if one user is connected via sockets and the other through the TCP/IP connection it would explain the problem because MySQL treats different incoming hosts and connection types as different users. 即使您使用相同的用户名连接,如果一个用户通过套接字连接,另一个用户通过TCP / IP连接连接,它也会解释问题,因为MySQL将不同的传入主机和连接类型视为不同的用户。

To check this, look at the main page of phpMyAdmin, on the right side where it shows "Server" and "User" listed under the Database server section. 要检查这一点,请查看phpMyAdmin的主页,该页面在右侧显示“数据库服务器”部分下列出的“服务器”和“用户”。 Then connect from the command line client and run the status; 然后从命令行客户端连接并运行status; command, and compare the output. 命令,并比较输出。

To fix it, either connect as the correct user (the -u and -h options may be helpful here), or grant the proper permissions to the user you're connecting as from the command line. 要解决此问题,请以正确的用户身份进行连接(此处-u-h选项可能会有所帮助),或者以命令行方式为要连接的用户授予适当的权限。

Test is probably just a demo or test table and has no relation to your wordpress work or the problem seeing the wordpress database. 测试可能只是一个演示或测试表,与您的wordpress工作或查看wordpress数据库的问题无关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM