phpmyadmin is working fine but I can't find co

2019-02-17 04:33发布

问题:

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

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?

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

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.

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.

回答1:

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

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

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

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



回答2:

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



回答3:

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:

  1. go to config.inc.php file

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

put ur password in ' ' that u changed.

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



回答4:

Open up [web_root]/libraries/Config.class.php add these lines to the beginning of the method 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 $cfg which is the config of PMA, for me the output was:

'[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.

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

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



回答5:

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