Skip to content
Find file
3079 lines (2076 sloc) 97.1 KB

Configuration

All configurable data is placed in :file:`config.inc.php` in phpMyAdmin's toplevel directory. If this file does not exist, please refer to the :ref:`setup` section to create one. This file only needs to contain the parameters you want to change from their corresponding default value in :file:`libraries/config.default.php` (this file is not inteded for changes).

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 :file:`themes/themename/layout.inc.php`. You might also want to create :file:`config.footer.inc.php` and :file:`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 :file:`config.inc.php` in /etc/phpmyadmin instead of within phpMyAdmin sources.

Warning

:term:`Mac` users should note that if you are on a version before :term:`Mac OS X`, PHP does not seem to like :term:`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.

Basic settings

Server connection settings

Generic settings

Cookie authentication options

Navigation panel setup

Main panel

Database structure

Browse mode

Editing mode

Export and import settings

Tabs display settings

PDF Options

Languages

Web server settings

Theme settings

Please directly modify :file:`themes/themename/layout.inc.php`, although your changes will be overwritten with the next update.

Design customization

Text fields

SQL query box settings

Web server upload/save/import directories

Various display setting

Page titles

Theme manager settings

Default queries

MySQL settings

Developer

Warning

These settings might have huge effect on performance or security.

Examples

See following configuration snippets for usual setups of phpMyAdmin.

Basic example

Example configuration file, which can be copied to :file:`config.inc.php` to get some core configuration layout, it is distributed with phpMyAdmin as :file:`config.sample.inc.php`. Please note that it does not contain all configuration options, only the most frequently used ones.

Warning

Don't use the controluser 'pma' if not existing yet and don't use 'pmapass' as password.

Example for signon authentication

This example uses :file:`examples/signon.php` to demostrate usage of :ref:`auth_signon`:

<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['extension']     = 'mysqli';
$cfg['Servers'][$i]['auth_type']     = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL']     = 'examples/signon.php';
?>`

Example for IP address limited autologin

If you want to automatically login when accessing phpMyAdmin locally while ask for password when 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.

Google Cloud SQL with SSL

To connect to Google Could SQL, you currently need to disable certificate verification. This is caused by the certficate being issued for CN matching your instance name, but you connect to an IP address and PHP tries to match these two. With verfication 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;
Something went wrong with that request. Please try again.