MySQL config.inc.php 的 phpMyAdmin 权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18923347/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:55:21  来源:igfitidea点击:

phpMyAdmin permissions for config.inc.php

mysqlphpmyadmin

提问by BenUNC

Running an EC2 instance, have installed phpMyAdmin and when I create the config.inc.php file (and move it to the top level directory) and then try to navigate via browser to (mydomain)/phpmyadmin and I get this:

运行 EC2 实例,已安装 phpMyAdmin,当我创建 config.inc.php 文件(并将其移动到顶级目录)然后尝试通过浏览器导航到 (mydomain)/phpmyadmin 时,我得到了这个:

"Wrong permissions on configuration file, should not be world writable!"

“配置文件权限错误,不应该是全局可写的!”

So, I ran this command:

所以,我运行了这个命令:

chmod 755 config.inc.php

chmod 755 config.inc.php

And then when I reload the browser page I get the default chrome "Server Error" page as though there is nothing there at all.

然后当我重新加载浏览器页面时,我得到默认的 chrome“服务器错误”页面,好像那里什么都没有。

I have repeated the process several times, with no luck.

我已经多次重复这个过程,但没有运气。

采纳答案by Isaac Bennetch

It's possible that there's an error in the config.inc.php file (IIRC, the test for permissions comes before trying to load the file), so you should first check your webserver error log for hints about what is causing the "Server Error" message.

config.inc.php 文件中可能存在错误(IIRC,在尝试加载文件之前进行权限测试),因此您应该首先检查您的网络服务器错误日志,以获取有关导致“服务器错误”的原因的提示信息。

You can also try loading the config.inc.php file directly (http://example.com/phpmyadmin/config.inc.phpor whatever your path is), that might show a better error message.

您也可以尝试直接加载 config.inc.php 文件(http://example.com/phpmyadmin/config.inc.php或任何您的路径),这可能会显示更好的错误消息。

回答by dokam_scotland

If chmod 0644 config.inc.php does not help, perhaps due to a file system issue, you can just disable the check by adding the following to the file:

如果 chmod 0644 config.inc.php 没有帮助,可能是由于文件系统问题,您可以通过在文件中添加以下内容来禁用检查:

$cfg['CheckConfigurationPermissions'] = false;

回答by Suraj Bhatt

change permission of file my.cnf as "sudo chmod 644 -R /opt/lampp/etc/my.cnf". it worked for me.

将文件 my.cnf 的权限更改为“sudo chmod 644 -R /opt/lampp/etc/my.cnf”。它对我有用。

回答by Ali Yousuf

Change the permission of config.inc.php to 644. It worked for me.

将 config.inc.php 的权限更改为 644。它对我有用。

回答by sh6210

While i was customizing my settings i changed many places permission through chown and chmod. After that i got this error and solved the problem.

在自定义设置时,我通过 chown 和 chmod 更改了许多地方的权限。之后,我收到此错误并解决了问题。

  • on my machine config.inc.phpis under /Users/"UserAccountName"/Sites/phpmyadmin/ directory.

  • i visited this directory and gave permission "sudo chmod 0755 config.inc.php"

  • 在我的机器上config.inc.php位于 /Users/"UserAccountName"/Sites/phpmyadmin/ 目录下。

  • 我访问了这个目录并授予权限“sudo chmod 0755 config.inc.php”

thats it, and i'm done.

就是这样,我完成了。

回答by Marc Delisle

If you cannot work around the filesystem-related issues, the preferred solution is to avoid this verification, see https://phpmyadmin.readthedocs.org/en/latest/config.html#cfg_CheckConfigurationPermissions

如果您无法解决与文件系统相关的问题,首选解决方案是避免此验证,请参阅 https://phpmyadmin.readthedocs.org/en/latest/config.html#cfg_CheckConfigurationPermissions

回答by Abhijeet Navgire

Change the permission of config.inc.php through command as below

通过如下命令修改config.inc.php的权限

sudo chmod -R 777 config.inc.php

须藤 chmod -R 777 config.inc.php

回答by Sygmoral

If chmod 0644 config.inc.phpdoes not help, perhaps due to a filesystem issue, you can just disable the check by adding the following to the file:

如果chmod 0644 config.inc.php没有帮助,可能是由于文件系统问题,您可以通过将以下内容添加到文件中来禁用检查:

$cfg['CheckConfigurationPermissions'] = false;

$cfg['CheckConfigurationPermissions'] = false;

回答by Raham

if you are using Linux and you have /opt/lamppthen write the following command in the terminal.

如果您使用的是 Linux,/opt/lampp然后在终端中编写以下命令。

sudo pkexec chmod 755 -R /opt/lampp/phpmyadmin

Hope it will resolve the issue.

希望它能解决问题。

回答by whocares81

setting the file attribute (under windows) to writeproteced works, too.

将文件属性(在 Windows 下)设置为 writeproteced 也有效。