phpmyadmin 工作正常,但我找不到 config.inc.php 文件?

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

phpmyadmin is working fine but I can't find config.inc.php file?

phpphpmyadmin

提问by ethmz

This is weird

这很奇怪

I have phpmyadmin 4.2.5 installed on my Windows 7 machine, it currently is working fine and located in localhost/phpmyadmin

我在我的 Windows 7 机器上安装了 phpmyadmin 4.2.5,它目前工作正常并且位于 localhost/phpmyadmin

I can view, edit, create databases, tables, etc.

我可以查看、编辑、创建数据库、表格等。

Now I wanted to change some settings and so I looked for the config.inc.php file in the phpmyadmin directory but it's not there?

现在我想更改一些设置,所以我在 phpmyadmin 目录中查找了 config.inc.php 文件,但它不在那里?

I have a config.sample.inc.php but obviously it's just a sample

我有一个 config.sample.inc.php 但显然它只是一个示例

I did a search and the only config.inc.php file is in the /setup/frames/ folder which is clearly not the main config file.

我进行了搜索,唯一的 config.inc.php 文件位于 /setup/frames/ 文件夹中,这显然不是主配置文件。

So where is it? I installed phpmyadmin last month and I think I just copied it to my htdocs folder, nothing special, but I can't remember if I did something different.

那么它在哪里呢?我上个月安装了 phpmyadmin,我想我只是将它复制到我的 htdocs 文件夹中,没什么特别的,但我不记得我做了什么不同的事情。

回答by EternalHour

The config.inc.phpfile is not required, and only needed for custom configurations

config.inc.php文件不是必需的,仅用于自定义配置

phpmyadmin will first refer to ./libraries/config.default.phpto retrieve the default values.

phpmyadmin 将首先引用以./libraries/config.default.php检索默认值。

If for some reason you need to modify the default values, and the ./config.inc.phpfile doesn't exist, you will need to create one as per the Installationdocumentation.

如果由于某种原因需要修改默认值,而该./config.inc.php文件不存在,则需要根据安装文档创建一个。

You will also need to configure pmadbfor some of phpmyadmin's special features such as bookmarks.

您还需要为phpmyadmin 的一些特殊功能(例如书签)配置 pmadb

回答by isuruAb

rename config.sample.inc.php to config.inc.php and edit whatever you want in it.

将 config.sample.inc.php 重命名为 config.inc.php 并编辑您想要的任何内容。

回答by Bilal Ahmad

if by mistake you have changed the password of your default user('root') and now phpmyadmin is not even allowing you to open it than:

如果您错误地更改了默认用户('root')的密码,现在 phpmyadmin 甚至不允许您打开它,而不是:

  1. go to config.inc.phpfile

  2. change your $cfg['Servers'][$i]['password'] = ' '

  1. 转到config.inc.php文件

  2. 更改您的$cfg['Servers'][$i]['password'] = ' '

put ur password in ' 'that u changed.

将您的密码放在您更改的“ ”中。

C:\wamp\apps\phpmyadmin4.1.14for config.inc.php

C:\wamp\apps\phpmyadmin4.1.14用于config.inc.php

回答by shampoo

Open up [web_root]/libraries/Config.class.phpadd these lines to the beginning of the method load:

打开[web_root]/libraries/Config.class.php将这些行添加到方法的开头load

      var_dump( $this->default_source);
      var_dump( CONFIG_FILE);
      die; 

Open phpmyadmin. This is the order of config files loaded, they make a variable $cfgwhich is the config of PMA, for me the output was:

打开 phpmyadmin。这是加载配置文件的顺序,它们创建了一个变量$cfg,它是 PMA 的配置,对我来说输出是:

'[mywebroot]./libraries/config.default.php'
'/etc/phpmyadmin/config.inc.php'

Make sure the last file, which is for local changes, exist and have correct permissions. Then get rid of the added lines.

确保用于本地更改的最后一个文件存在并具有正确的权限。然后去掉添加的行。

More info

更多信息

PMA loads it's global configuration in the file libraries/common.inc.php:306.

PMA 在文件中加载它的全局配置libraries/common.inc.php:306

$GLOBALS['PMA_Config'] = new PMA_Config(CONFIG_FILE);

The global is an instance of PMA_Configwhose constructor calls the loadmethod. In load method, the parameter passed to the constructor, CONFIG_FILEis used to load the configuration.

全局是PMA_Config其构造函数调用该load方法的实例。在 load 方法中,传递给构造函数的参数CONFIG_FILE用于加载配置。

回答by Md Wasi

Go to path c:\xamp\phpmyadmin.In that folder config.inc.phpfile would be present.

转到路径c:\xamp\phpmyadmin。在该文件夹中config.inc.php文件将存在。