Config/Servers

From PmaWiki
Jump to: navigation, search

The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0]. If you want more than one server, just copy following section (including $i incrementation) serveral times. There is no need to define full server array, just define values you need to change.

Contents

[edit] host

The hostname of the MySQL server.

Possible values are:

  • 'hostname', e.g., localhost or mydb.test.org
  • 'IP address', e.g., 127.0.0.1 or 192.168.10.1
  • '.' - dot, i.e., use named pipes on windows systems
  • '' - empty, disables this server

BEWARE, If you set this:

$cfg['Servers'][$i]['host'] = 'localhost';

Then PhpMyAdmin will IGNORE your settings for: 'port', 'socket', and 'connect_type'. It will simply connect to the default socket.

If your database is on the localhost, use the IP instead:

$cfg['Servers'][$i]['host'] = '127.0.0.1';

Then 'port', 'socket', and 'connect_type' will work exactly as expected.

[edit] port

MySQL port - leave blank for default port, which normally is 3306.

$cfg['Servers'][$i]['port'] = '';

[edit] socket

Path to the socket - leave blank for default socket

$cfg['Servers'][$i]['socket'] = '';

[edit] ssl

This feature is available since phpMyAdmin 2.10.0.

Use SSL for the MySQL connection (requires PHP >= 4.3.0)

$cfg['Servers'][$i]['ssl'] = FALSE;

In phpMyAdmin 2.10.0.0 unfortunately the default setting was TRUE. Set it to FALSE if you get the MySQL error "#1043 - Bad handshake" or "#2026 - SSL connection error".

[edit] connect_type

How to connect to MySQL server (tcp or socket).

$cfg['Servers'][$i]['connect_type'] = 'tcp';

[edit] extension

The PHP MySQL extension to use (mysql or mysqli).

$cfg['Servers'][$i]['extension'] = 'mysqli';
Changed in phpMyAdmin 3.4.0 :
$cfg['Servers'][$i]['extension'] = 'mysqli';

[edit] compress

Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)

$cfg['Servers'][$i]['compress'] = FALSE;

[edit] controluser

MySQL control user settings (this user must have read-only access to the "mysql/user" and "mysql/db" tables). The controluser is also used for all relational features (pmadb).

$cfg['Servers'][$i]['controluser'] = root;

[edit] controlpass

The password needed for the controluser to login (see $cfg['Servers'][$i]['controluser']).

$cfg['Servers'][$i]['controlpass'] = admin;

[edit] controlport

This feature is available since phpMyAdmin 4.1.0.

Permits to use an alternate port to connect to the host that holds the configuration storage.

$cfg['Servers'][$i]['controlport'] = '';

[edit] auth_type

Authentication method used to authenticate users (config, http, signon, or cookie), see authentication methods.

$cfg['Servers'][$i]['auth_type'] = 'config';
Changed in phpMyAdmin 3.1.0 :
$cfg['Servers'][$i]['auth_type'] = 'config';

[edit] auth_http_realm

When using auth_type = 'http', this field allows to define a custom HTTP Basic Auth Realm which will be displayed to the user. If not explicitly specified in your configuration, a string combined of "phpMyAdmin " and either $cfg['Servers'][$i]['verbose'] or $cfg['Servers'][$i]['host'] will be used.

$cfg_['Servers'][$i]['auth_http_realm'] = '';

[edit] auth_swekey_config

This feature is available since phpMyAdmin 3.1.0.

The name of the file containing Swekey ids and login names for hardware authentication. Leave the string empty to deactivate this feature.

$cfg['Servers'][$i]['auth_swekey_config']  = '';

[edit] user

MySQL user which should be used to connect to the database, only needed when using config as $cfg['Servers'][$i]['auth_type'].

$cfg['Servers'][$i]['user'] = 'u130247';

[edit] password

MySQL password which should be used to connect to the database, only needed when using config as $cfg['Servers'][$i]['auth_type'].

$cfg['Servers'][$i]['password'] = 'GCpNMDZJf9q47umx;

[edit] nopassword

Allow attempt to log in without password when a login with password fails. This can be used together with http authentication, when authentication is done some other way and phpMyAdmin gets user name from auth and uses empty password for connecting to MySQL. Password login is still tried first, but as fallback, no password method is tried.

$cfg['Servers'][$i]['nopassword'] = true;

[edit] only_db

If set to a db-name, only this db is displayed in left frame. It may also be an array of db-names, where sorting order is relevant. For example: $cfg['Servers'][$i]['only_db'] = array('db1', 'db2');. This does not replace using proper privilege rules on the MySQL server - it only hides the database in the navigation frame. Since phpMyAdmin 2.2.1, this/these database(s) name(s) may contain MySQL wildcards characters (_ and %); if you want to use literal instances of these characters, escape them (i.e. use my\_db and not my_db).

If you want to have certain databases at the top, but don't care about the others, you do not need to specify all other databases. Use: $cfg['Servers'][$i]['only_db'] = array('db3', 'db4', '*'); instead to tell phpMyAdmin that it should display db3 and db4 on top, and the rest in alphabetic order.

$cfg['Servers'][$i]['only_db'] = '';

[edit] hide_db

Regular expression for database name(s) to be hidden from listings. This does not replace using proper privilege rules on the MySQL server - it only hides the database in the navigation frame.

For example, to hide all databases beginning with the letter a use: $cfg['Servers'][$i]['hide_db'] = '^a';. To hide multiple databases by name use $cfg['Servers'][$i]['hide_db'] = '(information_schema|phpmyadmin|mysql)'.

More information on regular expressions in PHP can be found in the PCRE pattern reference portion of the PHP manual.

$cfg['Servers'][$i]['hide_db'] = '';

[edit] verbose

Verbose name for this host - leave blank to show the hostname

$cfg['Servers'][$i]['verbose'] = '';          

[edit] pmadb

Database used for relations, bookmarks, and PDF features (see scripts/create_tables.sql). See pmadb for complete information. Leave blank for no support DEFAULT: 'phpmyadmin'

$cfg['Servers'][$i]['pmadb'] = '';

[edit] bookmarktable

Bookmark table - leave blank for no bookmark support DEFAULT: 'pma_bookmark'

$cfg['Servers'][$i]['bookmarktable'] = '';

[edit] relation

Table to describe the relation between links (more information in Documentation.html) - leave blank for no relation-links support DEFAULT: 'pma_relation'

$cfg['Servers'][$i]['relation'] = '';

[edit] table_info

Table to describe the display fields - leave blank for no display fields support DEFAULT: 'pma_table_info'

$cfg['Servers'][$i]['table_info'] = '';          

[edit] table_coords

Table to describe the tables position for the PDF schema - leave blank for no PDF schema support DEFAULT: 'pma_table_coords'

$cfg['Servers'][$i]['table_coords'] = '';          

[edit] pdf_pages

Table to describe pages of relationpdf - leave blank if you don't want to use this DEFAULT: 'pma_pdf_pages'

$cfg['Servers'][$i]['pdf_pages'] = '';          

[edit] column_info

Table to store column information - leave blank for no column comments/mime types DEFAULT: 'pma_column_info'

$cfg['Servers'][$i]['column_info'] = '';          

[edit] history

Table to store SQL history - leave blank for no SQL query history DEFAULT: 'pma_history'

$cfg['Servers'][$i]['history'] = '';

[edit] recent

This feature is available since phpMyAdmin 3.5.0.

Table to store a list of recently used tables to be shown in the left navigation frame. It helps you to jump across table directly, without the need to select the database, and then select the table. Using $cfg['LeftRecentTable'] you can configure the maximum number of recent tables shown.

Without configuring the storage, you can still access the recently used tables, but it will disappear after you logout. DEFAULT: 'pma_recent'

$cfg['Servers'][$i]['recent'] = '';

[edit] table_uiprefs

This feature is available since phpMyAdmin 3.5.0.

Table to store user interface enhancement data. Leave blank to disable. DEFAULT: 'pma_table_uiprefs'

$cfg['Servers'][$i]['table_uiprefs']  = '';

phpMyAdmin can be configured to remember several things (such as table sorting when browsing tables). Without configuring this storage, those features can still be used, but the values will disappear after you logout.

[edit] navigationhiding

This feature is available since phpMyAdmin 4.1.0.

Table to store items hidden from navigation tree - leave blank to disable DEFAULT: 'pma__navigationhiding '

$cfg['Servers'][$i]['navigationhiding '] = '';

[edit] usergroups

This feature is available since phpMyAdmin 4.1.0.

Table to store menu items shown to users belonging to different user groups - leave blank to disable DEFAULT: 'pma__usergroups'

$cfg['Servers'][$i]['usergroups '] = '';

[edit] users

This feature is available since phpMyAdmin 4.1.0.

Table to store users and their assingnment to different user groups - leave blank to disable DEFAULT: 'pma__users'

$cfg['Servers'][$i]['users '] = '';

[edit] tracking

This feature is available since phpMyAdmin 3.3.

Table to store version/change tracking data - leave blank to disable DEFAULT: 'pma_tracking'

$cfg['Servers'][$i]['tracking'] = '';

[edit] tracking_version_auto_create

Whether the tracking mechanism creates versions for tables and views automatically DEFAULT: FALSE

$cfg['Servers'][$i]['tracking_version_auto_create'] = FALSE;

[edit] tracking_default_statements

Defines the list of statements the auto-creation uses for new versions. DEFAULT:

CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,
CREATE INDEX,DROP INDEX,
INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,
CREATE VIEW,ALTER VIEW,DROP VIEW,
CREATE DATABASE,ALTER DATABASE,DROP DATABASE
$cfg['Servers'][$i]['tracking_default_statements'] = '';

[edit] tracking_add_drop_view

Whether a DROP VIEW IF EXISTS statement will be added as first line to the log when creating a view. Default: TRUE.

$cfg['Servers'][$i]['tracking_add_drop_view'] = TRUE;

[edit] tracking_add_drop_table

Whether a DROP TABLE IF EXISTS statement will be added as first line to the log when creating a table. Default: TRUE.

$cfg['Servers'][$i]['tracking_add_drop_table'] = TRUE;

[edit] tracking_add_drop_database

Whether a DROP DATABASE IF EXISTS statement will be added as first line to the log when creating a database. Default: TRUE

$cfg['Servers'][$i]['tracking_add_drop_database'] = TRUE;

[edit] userconfig

This feature is available since phpMyAdmin 3.4.0.

Table to store user preferences -- allows users to set most preferences by themselves and store them in the phpMyAdmin configuration storage database.

If you don't allow for storing preferences in pmadb, users can still personalize phpMyAdmin, but settings will be saved in browser's local storage, or, it is is unavailable, until the end of session. DEFAULT: 'pma_userconfig'

$cfg['Servers'][$i]['userconfig'] = root;

[edit] designer_coords

Table in which to store information for the designer feature. DEFAULT: 'pma_designer_coords'

$cfg['Servers'][$i]['designer_coords'] = '';

[edit] MaxTableUiprefs

Maximum number of records saved in table_uiprefs.

$cfg['Servers'][$i]['MaxTableUiprefs'] = 100;

[edit] verbose_check

Set to FALSE if you know that your pma_* tables are up to date. This prevents compatibility checks and thereby increases performance.

$cfg['Servers'][$i]['verbose_check'] = TRUE;

[edit] AllowRoot

Whether to allow root login

$cfg['Servers'][$i]['AllowRoot'] = TRUE;

[edit] AllowNoPassword

This feature is available since phpMyAdmin 3.2.0.

Whether to allow logins without a password. The default value of false for this parameter prevents unintended access to a MySQL server with was left with an empty password for root or on which an anonymous (blank) user is defined.

$cfg['Servers'][$i]['AllowNoPassword'] = true;

[edit] AllowNoPasswordRoot

This feature is available since phpMyAdmin 3.1.0.


This item is outdated and applies only to {{ #if: 3.2.0 | versions prior to phpMyAdmin 3.2.0| older phpMyAdmin versions}}.
{{ #if: 3.2.0 ||}}

By popular request, this directive will be replaced by AllowNoPassword in future versions (starting with 3.2.0).

Whether to allow access to root user without password. The default value of false for this parameter prevents unintended access to a MySQL server with was left with an empty password for root.

$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;

[edit] AllowDeny (order)

Host authentication order, leave blank to not use

$cfg['Servers'][$i]['AllowDeny']['order'] = ''

If your rule order is empty, then IP authentication is disabled.

If your rule order is set to 'deny,allow' then the system applies all deny rules followed by allow rules. Access is allowed by default. Any client which does not match a Deny command or does match an Allow command will be allowed access to the server.

If your rule order is set to 'allow,deny' then the system applies all allow rules followed by deny rules. Access is denied by default. Any client which does not match an Allow directive or does match a Deny directive will be denied access to the server.

If your rule order is set to 'explicit', the authentication is performed in a similar fashion to rule order 'deny,allow', with the added restriction that your host/username combination must be listed in the allow rules, and not listed in the deny rules. This is the most secure means of using Allow/Deny rules, and was available in Apache by specifying allow and deny rules without setting any order.

Please also see $cfg['TrustedProxies'] for detecting IP address behind proxies.

[edit] AllowDeny (rules)

Host authentication rules, leave blank for defaults

$cfg['Servers'][$i]['AllowDeny']['rules'] = array();// of strings

The general format for the rules is as such:

<'allow' | 'deny'> <username> [from] <ipmask>

example: array('deny root from all', 'allow root from localhost', 'allow root from 192.168.0.0/24');

If you wish to match all users, it is possible to use a '%' as a wildcard in the username field. There are a few shortcuts you can use in the ipmask field as well (please note that those containing SERVER_ADDRESS might not be available on all webservers):

'all' -> 0.0.0.0/0
'localhost' -> 127.0.0.1/8
'localnetA' -> SERVER_ADDRESS/8
'localnetB' -> SERVER_ADDRESS/16
'localnetC' -> SERVER_ADDRESS/24

Having an empty rule list is equivalent to either using 'allow % from all' if your rule order is set to 'deny,allow' or 'deny % from all' if your rule order is set to 'allow,deny' or 'explicit'.

For the IP matching system, the following work:

xxx.xxx.xxx.xxx (an exact IP address)
xxx.xxx.xxx.[yyy-zzz] (an IP address range)
xxx.xxx.xxx.xxx/nn (CIDR, Classless Inter-Domain Routing type IP addresses)

But the following does not work:

xxx.xxx.xxx.xx[yyy-zzz] (partial IP address range)

[edit] DisableIS

This feature is available since phpMyAdmin 3.0.0.

Disable use of INFORMATION_SCHEMA see http://sf.net/support/tracker.php?aid=1849494 and http://bugs.mysql.com/19588

$cfg['Servers'][$i]['DisableIS'] = true;

[edit] ShowDatabasesCommand

This feature is available since phpMyAdmin 3.0.0.

SQL command to fetch available databases

By default most user will be fine with SHOW DATABASES, for servers with a huge amount of databases it is possible to define a command which executes faster but with less information

Especially when accessing database servers from ISPs changing this command can result in a great speed improvement

examples:

'SHOW DATABASES'
"SHOW DATABASES LIKE '#user#\_%'" (#user# will be replaced by the current user)
'SELECT DISTINCT TABLE_SCHEMA FROM information_schema.SCHEMA_PRIVILEGES'
'SELECT SCHEMA_NAME FROM information_schema.SCHEMATA'
false

false will disable fetching databases from the server, only databases in $cfg['Servers'][$i]['only_db'] will be displayed

$cfg['Servers'][$i]['ShowDatabasesCommand'] = 'SHOW DATABASES';

[edit] CountTables

This feature is available since phpMyAdmin 3.0.0.


This item is outdated and applies only to {{ #if: 4.0.0 | versions prior to phpMyAdmin 4.0.0| older phpMyAdmin versions}}.
{{ #if: 4.0.0 ||}}

Whether to count tables when showing database list

$cfg['Servers'][$i]['CountTables'] = true;

[edit] SignonScript

This feature is available since phpMyAdmin 3.4.2.

Name of PHP script to be sources and executed to obtain login credentials. This is an alternative approach to session-based single signon. The script needs to provide function get_login_credentials which returns a list of username and password, accepting a single parameter of existing username (can be empty).

 $cfg['Servers'][$i]['SignonScript'] = '';

[edit] SignonSession

This feature is available since phpMyAdmin 2.10.0.

Name of session which will be used for signon authentication method, see authentication types for an example. Avoid using session name phpMyAdmin. Takes effect only if SignonScript is not configured.

 $cfg['Servers'][$i]['SignonSession'] = '';

[edit] SignonURL

This feature is available since phpMyAdmin 2.10.0.

URL where user will be redirected for login for signon authentication method. Should be absolute including protocol.

 $cfg['Servers'][$i]['SignonURL'] = '';

[edit] LogoutURL

This feature is available since phpMyAdmin 2.10.0.

URL where user will be redirected after logout (doesn't affect config authentication method). Should be absolute including protocol.

 $cfg['Servers'][$i]['LogoutURL'] = '';
Personal tools