config.inc.php
All configurable data is placed in config.inc.php
in phpMyAdmin's toplevel directory. If this file does not exist, please refer to the setup
section to create one. This file only needs to contain the parameters you want to change from their corresponding default value in libraries/config.default.php
(this file is not intended for changes).
config-examples
for examples of configurations
If a directive is missing from your file, you can just add another line with the file. This file is for over-writing the defaults; if you wish to use the default value there's no need to add a line here.
The parameters which relate to design (like colors) are placed in themes/themename/layout.inc.php
. You might also want to create config.footer.inc.php
and config.header.inc.php
files to add your site specific code to be included on start and end of each page.
Note
Some distributions (eg. Debian or Ubuntu) store config.inc.php
in /etc/phpmyadmin
instead of within phpMyAdmin sources.
Warning
Mac
users should note that if you are on a version before Mac OS X
, PHP does not seem to like Mac
end of lines character (\r
). So ensure you choose the option that allows to use the *nix end of line character (\n
) in your text editor before saving a script you have modified.
Please directly modify
themes/themename/layout.inc.php
, although your changes will be overwritten with the next update.
If PHP is running in safe mode, all directories must be owned by the same user as the owner of the phpMyAdmin scripts.
If the directory where phpMyAdmin is installed is subject to an open_basedir
restriction, you need to create a temporary directory in some directory accessible by the PHP interpreter.
For security reasons, all directories should be outside the tree published by webserver. If you cannot avoid having this directory published by webserver, limit access to it either by web server configuration (for example using .htaccess or web.config files) or place at least an empty index.html
file there, so that directory listing is not possible. However as long as the directory is accessible by web server, an attacker can guess filenames to download the files.
Note
These settings are mostly meant to be changed by user.
Warning
These settings might have huge effect on performance or security.
See following configuration snippets for typical setups of phpMyAdmin.
Example configuration file, which can be copied to config.inc.php
to get some core configuration layout; it is distributed with phpMyAdmin as config.sample.inc.php
. Please note that it does not contain all configuration options, only the most frequently used ones.
../config.sample.inc.php
Warning
Don't use the controluser 'pma' if it does not yet exist and don't use 'pmapass' as password.
This example uses examples/signon.php
to demonstrate usage of auth_signon
:
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'examples/signon.php';
If you want to automatically login when accessing phpMyAdmin locally while asking for a password when accessing remotely, you can achieve it using following snippet:
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'yourpassword';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
Note
Filtering based on IP addresses isn't reliable over the internet, use it only for local address.
You can configure any number of servers using :config$cfg['Servers']
, following example shows two of them:
<?php
$cfg['blowfish_secret']='multiServerExample70518';
//any string of your choice
$i = 0;
$i++; // server 1 :
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose'] = 'no1';
$cfg['Servers'][$i]['host'] = 'localhost';
// more options for #1 ...
$i++; // server 2 :
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose'] = 'no2';
$cfg['Servers'][$i]['host'] = 'remote.host.addr';//or ip:'10.9.8.1'
// this server must allow remote clients, e.g., host 10.9.8.%
// not only in mysql.host but also in the startup configuration
// more options for #2 ...
// end of server sections
$cfg['ServerDefault'] = 0; // to choose the server on startup
// further general options ...
To connect to Google Could SQL, you currently need to disable certificate verification. This is caused by the certificate being issued for CN matching your instance name, but you connect to an IP address and PHP tries to match these two. With verification you end up with error message like:
Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8'
Warning
With disabled verification your traffic is encrypted, but you're open to man in the middle attacks.
To connect phpMyAdmin to Google Cloud SQL using SSL download the client and server certificates and tell phpMyAdmin to use them:
// IP address of your instance
$cfg['Servers'][$i]['host'] = '8.8.8.8';
// Use SSL for connection
$cfg['Servers'][$i]['ssl'] = true;
// Client secret key
$cfg['Servers'][$i]['ssl_key'] = '../client-key.pem';
// Client certificate
$cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem';
// Server certification authority
$cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem';
// Disable SSL verification (see above note)
$cfg['Servers'][$i]['ssl_verify'] = false;
ssl
, :config$cfg['Servers'][$i]['ssl']
, :config$cfg['Servers'][$i]['ssl_key']
, :config$cfg['Servers'][$i]['ssl_cert']
, :config$cfg['Servers'][$i]['ssl_ca']
, :config$cfg['Servers'][$i]['ssl_verify']
, <https://bugs.php.net/bug.php?id=72048>