php MySQL 不显示在 phpMyAdmin 中创建的数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20909492/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL not showing databases created in phpMyAdmin
提问by t3po7re5
I'm trying to build a database for my server in phpmyadmin but when I finish building it I can't access it using PHP and it won't show when I list the databases in MySQL. But when I create a database in mySql it shows up in phpmyadmin. Also I'm running phpmyadmin version 4.0.3, and theres a statement at the bottom of the page saying The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
我正在尝试在 phpmyadmin 中为我的服务器构建一个数据库,但是当我完成构建它时,我无法使用 PHP 访问它,并且当我在 MySQL 中列出数据库时它不会显示。但是当我在 mySql 中创建一个数据库时,它会显示在 phpmyadmin 中。此外,我正在运行 phpmyadmin 4.0.3 版,页面底部有一条声明说The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
Thanks!
谢谢!
采纳答案by Oz Solomon
This sounds like a permissions issue. I'd guess that your phpMyAdmin is connecting to MySQL as root (or another user with the superuser privilege) and can therefore see all databases. Your app is probably connected using a different, lower privileged user.
这听起来像是权限问题。我猜想您的 phpMyAdmin 是以 root 身份(或其他具有超级用户权限的用户)连接到 MySQL 的,因此可以查看所有数据库。您的应用程序可能使用不同的低权限用户进行连接。
Try running select user();from your app and from phpMyAdmin and you will know for sure.
尝试select user();从您的应用程序和 phpMyAdmin运行,您肯定会知道。
Assuming your app is running with a different user, you will need to add privilages for it to access the database you create. Please read the section titled Assigning privileges to user for a specific databasein the phpMyAdmin documentation.
假设您的应用程序与不同的用户一起运行,您将需要为其添加权限以访问您创建的数据库。请阅读phpMyAdmin 文档中标题为为特定数据库的用户分配权限的部分。
回答by Tanzaho
I just had the problem, and realized that I was creating database with names with '_test' suffixes.
我刚刚遇到了问题,并意识到我正在创建名称带有“ _test”后缀的数据库。
It happens that phpmyadmin has a feature to hide some DBs. To change that behaviour, you can navigate to : settings > features > general > Hide databases
碰巧 phpmyadmin 具有隐藏某些数据库的功能。要更改该行为,您可以导航至:设置 > 功能 > 常规 > 隐藏数据库
By default, hiddent databases have these patterns : information_schema|mysql|performance_schema|test|phpmyadmin
默认情况下,hiddent 数据库具有以下模式:information_schema|mysql|performance_schema|test|phpmyadmin
回答by HymanSparrow
If you Still don't see it, Try to logout and then log in again to cPanel or PHPMyAdmin. It worked for me.
如果您仍然没有看到它,请尝试注销,然后再次登录到 cPanel 或 PHPMyAdmin。它对我有用。
回答by Destiny Alabi
This is pure permission issue. If you logged in without specifying the user, you won't see all the databases just like @t3po7re5 mentioned. What you should do is specify root user in your command.
这是纯粹的许可问题。如果您在未指定用户的情况下登录,您将看不到@t3po7re5 提到的所有数据库。您应该做的是在您的命令中指定 root 用户。
mysql -uroot -p
It will prompt you to then enter the password. this is the default password if you have not specified or changed the default root password depending on the local server you are using.
然后它会提示你输入密码。如果您尚未根据所使用的本地服务器指定或更改默认 root 密码,则这是默认密码。

