Configuration

BetterMyAdmin accepts every configuration directive of phpMyAdmin under the same name and with the same default value, plus a few of its own (BetterMyAdmin settings). Settings come from four layers, each overriding the one before:

  1. the defaults listed on this page;

  2. the variables of phpMyAdmin’s Docker image (Docker environment variables);

  3. a configuration file: --config <file>, the BMA_CONFIG environment variable, or the first of bettermyadmin.config.ts, .js, .mjs, .json, .yaml, .yml in the working directory (/etc/bettermyadmin in the Docker image);

  4. BMA__<Directive>[__<Sub>…] environment variables (BMA__Servers__1__host=db, BMA__MaxRows=50, BMA__Export__format=csv), plus the shortcuts BMA_HOST, BMA_PORT, BMA_USER, BMA_PASSWORD, BMA_ARBITRARY_SERVER and BMA_ABSOLUTE_URI.

If no configuration file exists, please refer to the Installation section to create one. The file only needs to contain the directives you want to change from their default value; if you wish to use the default value there’s no need to list it. An unknown directive or an invalid value stops the server with a message naming the closest directive (phpMyAdmin silently uses the default instead).

Notation

This page names the directives in phpMyAdmin’s notation, which is also what the setup script and phpMyAdmin’s own documentation use. In the configuration file:

  • $cfg['X'] is the key X of the file;

  • $cfg['X']['Y'] is the key Y of the object X ("Export": { "format": "csv" });

  • $cfg['Servers'][$i]['Y'] is the key Y of an entry of the Servers list, server 1 first.

For example, this bettermyadmin.config.json:

{
  "blowfish_secret": "a 32-byte or longer random string",
  "Servers": [
    { "host": "db.example.org", "port": 3306, "auth_type": "cookie" },
    { "host": "replica.example.org", "verbose": "Replica" }
  ],
  "MaxRows": 50,
  "Export": { "format": "csv" }
}

sets $cfg['blowfish_secret'], $cfg['Servers'][$i]['host'] of two servers, $cfg['MaxRows'] and $cfg['Export']['format']. The same configuration can be written as YAML, or as a JavaScript or TypeScript module whose default export is the object (see Installation). The code examples on this page are written as JSON.

Version notes such as “New in version 4.8.0” or “Deprecated since version 4.7.0” refer to phpMyAdmin’s versions. A directive that phpMyAdmin removed is accepted by BetterMyAdmin with a warning at start, and has no effect.

The look of the interface (colors, fonts) comes from the themes, see Custom Themes. phpMyAdmin’s config.header.inc.php and config.footer.inc.php include files are PHP and are not supported.

See also

Examples for examples of configurations

Basic settings

$cfg['PmaAbsoluteUri']
Type:

string

Default value:

''

Changed in version 4.6.5: This setting was not available in phpMyAdmin 4.6.0 - 4.6.4.

Sets here the complete public URL (with full path) at which users reach BetterMyAdmin. E.g. https://www.example.net/bettermyadmin/. Don’t forget the trailing slash at the end. The Docker variable PMA_ABSOLUTE_URI and the environment variable BMA_ABSOLUTE_URI set it too.

It is advisable to try leaving this blank. In most cases BetterMyAdmin automatically detects the proper setting. Users of port forwarding or complex reverse proxy setup might need to set this (see also $cfg['Listen']['basePath']).

A good test is to browse a table, edit a row and save it. If you get an error that this must be set or if the autodetect code fails to detect your path, please post a bug report on our bug tracker so we can improve the code.

$cfg['PmaNoRelation_DisableWarning']
Type:

boolean

Default value:

false

BetterMyAdmin offers a lot of features to work with master / foreign – tables (see $cfg['Servers'][$i]['pmadb']).

If you tried to set this up and it does not work for you, have a look on the Structure page of one database where you would like to use it. You will find a link that will analyze why those features have been disabled.

If you do not want to use those features set this variable to true to stop this message from appearing.

$cfg['AuthLog']
Type:

string

Default value:

'auto'

Added in version 4.8.0: This is supported since phpMyAdmin 4.8.0.

Configure authentication logging destination. Failed (or all, depending on $cfg['AuthLogSuccess']) authentication attempts will be logged according to this directive:

auto

Log to the server’s error output (stderr), like php and sapi. (phpMyAdmin logs to syslog when PHP has it; Node.js has no syslog.)

syslog

Nothing is logged: BetterMyAdmin has no syslog support.

php

Log to the server’s error output (stderr).

sapi

Log to the server’s error output (stderr).

/path/to/file

Any other value is treated as a filename and log entries are appended there, in phpMyAdmin’s format (M d H:i:s phpmyadmin: …).

A successful login is logged once per login (the session then keeps it), a failure at each failed login, and no-activity when a session expires.

Note

When logging to a file, make sure the user running BetterMyAdmin can write it.

$cfg['AuthLogSuccess']
Type:

boolean

Default value:

false

Added in version 4.8.0: This is supported since phpMyAdmin 4.8.0.

Whether to log successful authentication attempts into $cfg['AuthLog'].

$cfg['SuhosinDisableWarning']
Type:

boolean

Default value:

false

Deprecated since version 6.0.0: This setting has been removed. The Suhosin extension is no longer supported.

A warning is displayed on the main page if Suhosin is detected.

You can set this parameter to true to stop this message from appearing.

$cfg['LoginCookieValidityDisableWarning']
Type:

boolean

Default value:

false

In phpMyAdmin, a warning is displayed on the main page if the PHP parameter session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin.

Note

This directive has no effect in BetterMyAdmin: it has no PHP session settings (sessions are kept until twice the cookie lifetime has passed), so the warning never appears. It is accepted in the configuration but no settings form lists it.

$cfg['ServerLibraryDifference_DisableWarning']
Type:

boolean

Default value:

false

Deprecated since version 4.7.0: This setting was removed as the warning has been removed as well.

A warning is displayed on the main page if there is a difference between the MySQL library and server version.

You can set this parameter to true to stop this message from appearing.

$cfg['ReservedWordDisableWarning']
Type:

boolean

Default value:

false

This warning is displayed on the Structure page of a table if one or more column names match with words which are MySQL reserved.

If you want to turn off this warning, you can set it to true and warning will no longer be displayed.

$cfg['TranslationWarningThreshold']
Type:

integer

Default value:

80

Show warning about incomplete translations on certain threshold.

$cfg['SendErrorReports']
Type:

string

Default value:

'ask'

Valid values are:

  • ask

  • always

  • never

Sets the default behavior for JavaScript error reporting.

Whenever an error is detected in the JavaScript execution, an error report may be sent to the BetterMyAdmin project if the user agrees (phpMyAdmin sends its reports to phpmyadmin.net).

The default setting of 'ask' will ask the user everytime there is a new error report. However you can set this parameter to 'always' to send error reports without asking for confirmation or you can set it to 'never' to never send error reports.

This directive is available both in the configuration file and in users preferences. If the person in charge of a multi-user installation prefers to disable this feature for all users, a value of 'never' should be set, and the $cfg['UserprefsDisallow'] directive should contain 'SendErrorReports' in one of its array values.

$cfg['ConsoleEnterExecutes']
Type:

boolean

Default value:

false

Setting this to true allows the user to execute queries by pressing Enter instead of Ctrl+Enter. A new line can be inserted by pressing Shift+Enter.

The behaviour of the console can be temporarily changed using console’s settings interface.

$cfg['AllowThirdPartyFraming']
Type:

boolean|string

Default value:

false

Setting this to true allows BetterMyAdmin to be included inside a frame, and is a potential security hole allowing cross-frame scripting attacks or clickjacking. Setting this to ‘sameorigin’ prevents BetterMyAdmin to be included from another document in a frame, unless that document belongs to the same domain.

Besides the Content-Security-Policy frame-ancestors rule that phpMyAdmin sends, BetterMyAdmin also sends a matching X-Frame-Options header (DENY, or SAMEORIGIN for ‘sameorigin’, none for true).

BetterMyAdmin settings

These directives are BetterMyAdmin’s own; phpMyAdmin has no equivalent, as they concern what PHP and the web server do for it. Besides those below, BetterMyAdmin adds $cfg['Servers'][$i]['SignonPage'], $cfg['Servers'][$i]['max_connections'], $cfg['Export']['csv_escape_formulas'], $cfg['Export']['jsmodule_structure_or_data'] and $cfg['Import']['MaxDecompressedSize'], and it honours $cfg['ForceSSL'], which phpMyAdmin no longer does.

$cfg['Listen']
Type:

array

Default value:

{"host": "127.0.0.1", "port": 8080, "basePath": "/"}

Where BetterMyAdmin’s HTTP server listens. The command-line options --host and --port override it. In the Docker image the defaults are 0.0.0.0 and port 80 (BMA_LISTEN_PORT changes the port).

$cfg['Listen']['host']
Type:

string

Default value:

'127.0.0.1'

The address to listen on. The default accepts connections from the same machine only; use '0.0.0.0' (or a specific address) to accept them from the network, preferably behind a reverse proxy with TLS (see Securing your BetterMyAdmin installation).

$cfg['Listen']['port']
Type:

integer

Default value:

8080

The TCP port to listen on.

$cfg['Listen']['basePath']
Type:

string

Default value:

'/'

The URL path under which users reach BetterMyAdmin, for example '/bettermyadmin/' behind a reverse proxy. BetterMyAdmin’s cookies are scoped to this path.

$cfg['DataDir']
Type:

string

Default value:

'~/.bettermyadmin'

The directory where BetterMyAdmin keeps its own data: the sessions (sessions.sqlite), the generated $cfg['blowfish_secret'] (secret) and the local metadata store (local-metadata.sqlite), which keeps per-user data such as recent tables when no phpMyAdmin configuration storage is configured. ~ is the home directory of the user running BetterMyAdmin. The directory is created (mode 0700) if it does not exist. In the Docker image it is /var/lib/bettermyadmin; mount a volume there to keep the data across container restarts.

phpMyAdmin keeps sessions where PHP’s session settings say ($cfg['SessionSavePath']) and has no local metadata store.

$cfg['SessionStore']
Type:

string

Default value:

'sqlite'

Where sessions are kept: 'sqlite' stores them in sessions.sqlite in $cfg['DataDir']; 'redis' stores them in the Redis server of $cfg['RedisUrl'], so several BetterMyAdmin processes (behind a load balancer, or replicas of a container) share the logins. Each session is one key, bettermyadmin:session:<id>, expiring twice the longer of $cfg['LoginCookieValidity'] and $cfg['LoginCookieStore'] after its last request. When Redis cannot be reached or refuses the credentials at start, the server stops with the reason; once running, it reconnects by itself. All processes must share the same $cfg['blowfish_secret'].

$cfg['RedisUrl']
Type:

string

Default value:

''

The Redis server for 'redis' $cfg['SessionStore'], as a URL: redis://[[user]:password@]host[:port][/database], or rediss:// for TLS. For example redis://:secret@redis:6379/0, or with environment variables BMA__SessionStore=redis and BMA__RedisUrl=redis://:secret@redis:6379/0. It may contain a password, so it is treated as a secret and never shown to users.

$cfg['MaxUploadSize']
Type:

integer [number of bytes]

Default value:

536870912 (512 MiB)

The largest file a user can upload, for example to import it. phpMyAdmin is limited by PHP’s upload_max_filesize and post_max_size settings instead; BetterMyAdmin has no PHP settings, so this directive takes their place, and the messages that name the PHP settings in phpMyAdmin name it. The Docker variable UPLOAD_LIMIT (for example 64M) sets it.

$cfg['LoginRateLimit']
Type:

array

Default value:

{"enabled": true, "maxAttempts": 5, "windowSeconds": 900, "lockoutSeconds": 300}

Limits failed logins, for cookie and HTTP authentication: maxAttempts failed logins of one (IP address, username) pair within windowSeconds lock that pair out for lockoutSeconds, with the message “Too many failed login attempts. Please try again in %s seconds.” It is on by default. phpMyAdmin has no such limit and relies on the optional captcha ($cfg['CaptchaLoginPublicKey']), which BetterMyAdmin supports too.

$cfg['LoginRateLimit']['enabled']
Type:

boolean

Default value:

true

Whether failed logins are limited.

$cfg['LoginRateLimit']['maxAttempts']
Type:

integer

Default value:

5

The number of failed logins that locks a pair out.

$cfg['LoginRateLimit']['windowSeconds']
Type:

integer [number of seconds]

Default value:

900

The period in which the failed logins are counted.

$cfg['LoginRateLimit']['lockoutSeconds']
Type:

integer [number of seconds]

Default value:

300

How long a locked-out pair has to wait.

$cfg['TransformationsExternalPrograms']
Type:

array [list of strings]

Default value:

[]

The programs that the “External” transformation (Text/Plain: External, see Transformations) may run. Each entry is a program with its fixed arguments, for example "/usr/bin/tidy -q". Empty (the default): the transformation shows the value unchanged.

In phpMyAdmin this list is the $allowedPrograms array, which an administrator edits in the plugin’s PHP file. In BetterMyAdmin the programs run on the server without a shell: the configured words are the program and its fixed arguments, and the column’s transformation options can only add arguments, never shell syntax. A program is stopped after 10 seconds and its output is limited to 16 MiB.

Warning

Any user who can set a column’s transformation options can add arguments to the program and feed it any cell value: list only programs that cannot write or read files through their arguments, or wrapper scripts that ignore them.

{ "TransformationsExternalPrograms": ["/usr/bin/tidy -q"] }
$cfg['ConnectionPool']
Type:

array

Default value:

{"idleTimeout": 10, "maxTotal": 50, "waitTimeout": 30}

phpMyAdmin opens a MySQL connection for every request. BetterMyAdmin keeps connections open between requests, per session and server (at most $cfg['Servers'][$i]['max_connections'] each), and runs the same session set-up statements once per new connection.

$cfg['ConnectionPool']['idleTimeout']
Type:

integer [number of seconds]

Default value:

10

An idle connection is closed after this many seconds.

$cfg['ConnectionPool']['maxTotal']
Type:

integer

Default value:

50

The most MySQL connections the whole BetterMyAdmin process holds.

$cfg['ConnectionPool']['waitTimeout']
Type:

integer [number of seconds]

Default value:

30

How long a request waits for a connection when they are all in use.

$cfg['AgentApi']
Type:

boolean

Default value:

false

BetterMyAdmin only. Enables the agent API and its MCP endpoint (/api/agent/v1/…) for AI agents and scripts: see AI agents and scripts. Each request authenticates on its own as a MySQL user, with that user’s privileges.

Server connection settings

$cfg['Servers']
Type:

list

Default value:

one server with settings listed below

BetterMyAdmin supports the administration of multiple MySQL servers. The Servers list contains the login information for the different servers: the first entry’s $cfg['Servers'][$i]['host'] contains the hostname of the first server, the second entry’s the hostname of the second server, etc. You can put as many entries as you need in the configuration file (you don’t have to define all settings, just those you need to change).

{
  "Servers": [
    { "host": "db1.example.org" },
    { "host": "db2.example.org", "verbose": "Second server" }
  ]
}

Note

The first entry of the list is server 1 (phpMyAdmin’s $cfg['Servers'][1]). Servers may also be written as an object whose keys are the server numbers, from 1 ({"1": {…}, "2": {…}}). In environment variables, servers are numbered from 1: BMA__Servers__2__host=db2.example.org.

$cfg['Servers'][$i]['host']
Type:

string

Default value:

'localhost'

The hostname or IP address of your $i-th MySQL-server. E.g. localhost.

Possible values are:

  • hostname, e.g., 'localhost' or 'mydb.example.org'

  • IP address, e.g., '127.0.0.1' or '192.168.10.1'

  • IPv6 address, e.g. 2001:cdba:0000:0000:0000:0000:3257:9652

  • dot - '.', i.e., use named pipes on windows systems

  • empty - '', disables this server

Note

The hostname localhost is handled specially by MySQL and it uses the socket based connection protocol. To use TCP/IP networking, use an IP address or hostname such as 127.0.0.1 or db.example.com. You can configure the path to the socket with $cfg['Servers'][$i]['socket'].

$cfg['Servers'][$i]['port']
Type:

string

Default value:

''

The port-number of your $i-th MySQL-server. Default is 3306 (leave blank).

Note

If you use localhost as the hostname, MySQL ignores this port number and connects with the socket, so if you want to connect to a port different from the default port, use 127.0.0.1 or the real hostname in $cfg['Servers'][$i]['host'].

$cfg['Servers'][$i]['socket']
Type:

string

Default value:

''

The path to the socket to use. Leave blank for default. To determine the correct socket, check your MySQL configuration or, using the mysql command–line client, issue the status command. Among the resulting information displayed will be the socket used.

Note

This takes effect only if $cfg['Servers'][$i]['host'] is set to localhost.

$cfg['Servers'][$i]['ssl']
Type:

boolean

Default value:

false

Whether to enable SSL for the connection between BetterMyAdmin and the MySQL server to secure the connection.

$cfg['Servers'][$i]['ssl_key']
Type:

string

Default value:

NULL

Path to the client key file when using SSL for connecting to the MySQL server. This is used to authenticate the client to the server.

For example:

{ "Servers": [{ "ssl_key": "/etc/mysql/server-key.pem" }] }
$cfg['Servers'][$i]['ssl_cert']
Type:

string

Default value:

NULL

Path to the client certificate file when using SSL for connecting to the MySQL server. This is used to authenticate the client to the server.

$cfg['Servers'][$i]['ssl_ca']
Type:

string

Default value:

NULL

Path to the CA file when using SSL for connecting to the MySQL server.

$cfg['Servers'][$i]['ssl_ca_path']
Type:

string

Default value:

NULL

Directory containing trusted SSL CA certificates in PEM format.

$cfg['Servers'][$i]['ssl_ciphers']
Type:

string

Default value:

NULL

List of allowable ciphers for SSL connections to the MySQL server.

$cfg['Servers'][$i]['ssl_verify']
Type:

boolean

Default value:

true

Added in version 4.6.0: This is supported since phpMyAdmin 4.6.0.

With verification on, the server’s certificate must be signed by a trusted certificate authority (see $cfg['Servers'][$i]['ssl_ca']). If your SSL certificate is self-signed and not trusted, the connection will fail validation. Setting this to false will disable the validation check.

Warning

Disabling the certificate verification defeats purpose of using SSL. This will make the connection vulnerable to man in the middle attacks.

$cfg['Servers'][$i]['connect_type']
Type:

string

Default value:

'tcp'

Deprecated since version 4.7.0: This setting is no longer used as of 4.7.0, since MySQL decides the connection type based on host, so it could lead to unexpected results. Please set $cfg['Servers'][$i]['host'] accordingly instead.

What type connection to use with the MySQL server. Your options are 'socket' and 'tcp'. It defaults to tcp as that is nearly guaranteed to be available on all MySQL servers, while sockets are not supported on some platforms. To use the socket mode, your MySQL server must be on the same machine as BetterMyAdmin.

$cfg['Servers'][$i]['compress']
Type:

boolean

Default value:

false

Whether to enable client/server protocol compression for this database server connection (experimental).

When enabled, BetterMyAdmin asks the MySQL client library (mysql2) for a compressed connection, so that traffic between the BetterMyAdmin server and the database server is compressed. This affects only the database connection protocol. It does not compress SQL dumps, CSV/export downloads, or HTTP responses to the browser.

Compression can help on slow or metered links between BetterMyAdmin and the database server. On a local or low-latency network the CPU cost often outweighs any bandwidth savings, so leave this disabled unless you measure a benefit.

$cfg['Servers'][$i]['controlhost']
Type:

string

Default value:

''

Permits to use an alternate host to hold the configuration storage data.

$cfg['Servers'][$i]['controlport']
Type:

string

Default value:

''

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

$cfg['Servers'][$i]['controluser']
Type:

string

Default value:

''

$cfg['Servers'][$i]['controlpass']
Type:

string

Default value:

''

This special account is used to access phpMyAdmin configuration storage. You don’t need it in single user case, but if BetterMyAdmin is shared it is recommended to give access to phpMyAdmin configuration storage only to this user and configure BetterMyAdmin to use it. All users will then be able to use the features without need to have direct access to phpMyAdmin configuration storage.

Changed in version 2.2.5: those were called stduser and stdpass

$cfg['Servers'][$i]['control_*']
Type:

mixed

Added in version 4.7.0.

You can change any MySQL connection setting for control link (used to access phpMyAdmin configuration storage) using configuration prefixed with control_.

This can be used to change any aspect of the control connection, which by default uses same parameters as the user one.

For example you can configure SSL for the control connection:

{
  "Servers": [{
    "control_ssl": true,
    "control_ssl_key": "../client-key.pem",
    "control_ssl_cert": "../client-cert.pem",
    "control_ssl_ca": "../server-ca.pem"
  }]
}
$cfg['Servers'][$i]['auth_type']
Type:

string

Default value:

'cookie'

Whether config or cookie or HTTP or signon authentication should be used for this server.

  • ‘config’ authentication ("auth_type": "config") is the plain old way: username and password are stored in the configuration file.

  • ‘cookie’ authentication mode ("auth_type": "cookie") allows you to log in as any valid MySQL user with a login form.

  • ‘http’ authentication allows you to log in as any valid MySQL user via HTTP-Auth.

  • ‘signon’ authentication mode ("auth_type": "signon") allows you to log in with credentials handed over by another application, or returned by a JavaScript module.

$cfg['Servers'][$i]['auth_http_realm']
Type:

string

Default value:

''

When using 'http' for $cfg['Servers'][$i]['auth_type'], 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 “BetterMyAdmin “ and either $cfg['Servers'][$i]['verbose'] or $cfg['Servers'][$i]['host'] will be used.

$cfg['Servers'][$i]['auth_swekey_config']
Type:

string

Default value:

''

Added in version 3.0.0.0: This setting was named $cfg['Servers'][$i]['auth_feebee_config'] and was renamed before the 3.0.0.0 release.

Deprecated since version 4.6.4: This setting was removed because their servers are no longer working and it was not working correctly.

Deprecated since version 4.0.10.17: This setting was removed in a maintenance release because their servers are no longer working and it was not working correctly.

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

$cfg['Servers'][$i]['user']
Type:

string

Default value:

'root'

$cfg['Servers'][$i]['password']
Type:

string

Default value:

''

When using $cfg['Servers'][$i]['auth_type'] set to 'config', this is the user/password-pair which BetterMyAdmin will use to connect to the MySQL server. This user/password pair is not needed when HTTP or cookie authentication is used and should be empty.

$cfg['Servers'][$i]['nopassword']
Type:

boolean

Default value:

false

Deprecated since version 4.7.0: This setting was removed as it can produce unexpected results.

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.

Note

It is possible to allow logging in with no password with the $cfg['Servers'][$i]['AllowNoPassword'] directive.

$cfg['Servers'][$i]['only_db']
Type:

string or array

Default value:

''

If set to a (an array of) database name(s), only this (these) database(s) will be shown to the user. These database names 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').

This setting is an efficient way to lower the server load since the latter does not need to send MySQL requests to build the available database list. But it does not replace the privileges rules of the MySQL database server. If set, it just means only these databases will be displayed but not that all other databases can’t be used.

An example of using more than one database:

{ "Servers": [{ "only_db": ["db1", "db2"] }] }

Changed in version 4.0.0: Previous versions permitted to specify the display order of the database names via this directive.

$cfg['Servers'][$i]['hide_db']
Type:

string

Default value:

''

Regular expression for hiding some databases from unprivileged users. This only hides them from listing, but a user is still able to access them (using, for example, the SQL query area). To limit access, use the MySQL privilege system. For example, to hide all databases starting with the letter “a”, use

{ "Servers": [{ "hide_db": "^a" }] }

and to hide both “db1” and “db2” use

{ "Servers": [{ "hide_db": "^(db1|db2)$" }] }

The pattern is a JavaScript regular expression (without delimiters); for simple patterns like these it means the same as phpMyAdmin’s PCRE. More information can be found in the regular expressions guide.

$cfg['Servers'][$i]['verbose']
Type:

string

Default value:

''

Only useful when using BetterMyAdmin with multiple server entries. If set, this string will be displayed instead of the hostname in the pull-down menu on the main page. This can be useful if you want to show only certain databases on your system, for example. For HTTP auth, all non-US-ASCII characters will be stripped.

$cfg['Servers'][$i]['extension']
Type:

string

Default value:

'mysqli'

Deprecated since version 4.2.0: This setting was removed. The mysql extension will only be used when the mysqli extension is not available. As of 5.0.0, only the mysqli extension can be used.

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

Note

This directive has no effect in BetterMyAdmin, which is not PHP: it connects with the mysql2 Node.js driver.

$cfg['Servers'][$i]['pmadb']
Type:

string

Default value:

''

The name of the database containing the phpMyAdmin configuration storage.

See the phpMyAdmin configuration storage section in this document to see the benefits of this feature, and for a quick way of creating this database and the needed tables.

If you are the only user of this BetterMyAdmin installation, you can use your current database to store those special tables; in this case, just put your current database name in $cfg['Servers'][$i]['pmadb']. For a multi-user installation, set this parameter to the name of your central database containing the phpMyAdmin configuration storage.

$cfg['Servers'][$i]['bookmarktable']
Type:

string or false

Default value:

''

Added in version 2.2.0.

BetterMyAdmin allows users to bookmark queries. This can be useful for queries you often run. To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['relation']
Type:

string or false

Default value:

''

Added in version 2.2.4.

You can describe, in a special ‘relation’ table, which column is a key in another table (a foreign key). BetterMyAdmin currently uses this to:

The keys can be numeric or character.

To allow the usage of this functionality:

  • set up $cfg['Servers'][$i]['pmadb'] and the phpMyAdmin configuration storage

  • put the relation table name in $cfg['Servers'][$i]['relation']

  • now as normal user open BetterMyAdmin and for each one of your tables where you want to use this feature, click Structure/Relation view/ and choose foreign columns.

This feature can be disabled by setting the configuration to false.

Note

In the current version, master_db must be the same as foreign_db. Those columns have been put in future development of the cross-db relations.

$cfg['Servers'][$i]['table_info']
Type:

string or false

Default value:

''

Added in version 2.3.0.

You can describe, in a special table_info table, which column is to be displayed as a tool-tip when moving the cursor over the corresponding key. This configuration variable will hold the name of this special table. To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['table_coords']
Type:

string or false

Default value:

''

The designer feature can save your page layout; by pressing the “Save page” or “Save page as” button in the expanding designer menu, you can customize the layout and have it loaded the next time you use the designer. That layout is stored in this table. Furthermore, this table is also required for using the PDF relation export feature, see $cfg['Servers'][$i]['pdf_pages'] for additional details.

$cfg['Servers'][$i]['pdf_pages']
Type:

string or false

Default value:

''

Added in version 2.3.0.

You can have BetterMyAdmin create PDF pages showing the relations between your tables. Further, the designer interface permits visually managing the relations. To do this it needs two tables “pdf_pages” (storing information about the available PDF pages) and “table_coords” (storing coordinates where each table will be placed on a PDF schema output). You must be using the “relation” feature.

To allow the usage of this functionality:

This feature can be disabled by setting either of the configurations to false.

$cfg['Servers'][$i]['designer_coords']
Type:

string

Default value:

''

Added in version 2.10.0: Since release 2.10.0 a Designer interface is available; it permits to visually manage the relations.

Deprecated since version 4.3.0: This setting was removed and the Designer table positioning data is now stored into $cfg['Servers'][$i]['table_coords'].

Note

You can now delete the table pma__designer_coords from your phpMyAdmin configuration storage database and remove $cfg['Servers'][$i]['designer_coords'] from your configuration file.

$cfg['Servers'][$i]['column_info']
Type:

string or false

Default value:

''

Added in version 2.3.0.

This part requires a content update! You can store comments to describe each column for each table. These will then be shown on the “printview”.

Starting with release 2.5.0, comments are consequently used on the table property pages and table browse view, showing up as tool-tips above the column name (properties page) or embedded within the header of table in browse view. They can also be shown in a table dump. Please see the relevant configuration directives later on.

Also new in release 2.5.0 is a MIME- transformation system which is also based on the following table structure. See Transformations for further information. To use the MIME- transformation system, your column_info table has to have the three new columns 'mimetype', 'transformation', 'transformation_options'.

Starting with release 4.3.0, a new input-oriented transformation system has been introduced. Also, backward compatibility code used in the old transformations system was removed. As a result, an update to column_info table is necessary for previous transformations and the new input-oriented transformation system to work. BetterMyAdmin will upgrade it automatically for you by analyzing your current column_info table structure. However, if something goes wrong with the auto-upgrade then you can use the SQL script found in the repository at packages/metadata/resources/upgrade_column_info_4_3_0+.sql to upgrade it manually.

To allow the usage of this functionality:

  • set up $cfg['Servers'][$i]['pmadb'] and the phpMyAdmin configuration storage

  • put the table name in $cfg['Servers'][$i]['column_info'] (e.g. pma__column_info)

  • to update your PRE-2.5.0 column_comments table use this: and remember that the directive has been renamed from $cfg['Servers'][$i]['column_comments'] to $cfg['Servers'][$i]['column_info']

    ALTER TABLE `pma__column_comments`
    ADD `mimetype` VARCHAR(255) NOT NULL,
    ADD `transformation` VARCHAR(255) NOT NULL,
    ADD `transformation_options` VARCHAR(255) NOT NULL;
    
  • to update your PRE-4.3.0 column_info table manually use the packages/metadata/resources/upgrade_column_info_4_3_0+.sql SQL script.

This feature can be disabled by setting the configuration to false.

Note

For auto-upgrade functionality to work, your $cfg['Servers'][$i]['controluser'] must have ALTER privilege on phpmyadmin database. See the MySQL documentation for GRANT on how to GRANT privileges to a user.

$cfg['Servers'][$i]['history']
Type:

string or false

Default value:

''

Added in version 2.5.0.

You can store your SQL history, which means all queries you entered manually into the BetterMyAdmin interface. If you don’t want to use a table-based history, you can use the JavaScript-based history.

Using that, all your history items are deleted when closing the window. Using $cfg['QueryHistoryMax'] you can specify an amount of history items you want to have on hold. On every login, this list gets cut to the maximum amount.

The query history is only available if JavaScript is enabled in your browser.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['recent']
Type:

string or false

Default value:

''

Added in version 3.5.0.

You can show recently used tables in the navigation panel. It helps you to jump across table directly, without the need to select the database, and then select the table. Using $cfg['NumRecentTables'] you can configure the maximum number of recent tables shown. When you select a table from the list, it will jump to the page specified in $cfg['NavigationTreeDefaultTabTable'].

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

To allow the usage of this functionality persistently:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['favorite']
Type:

string or false

Default value:

''

Added in version 4.2.0.

You can show a list of selected tables in the navigation panel. It helps you to jump to the table directly, without the need to select the database, and then select the table. When you select a table from the list, it will jump to the page specified in $cfg['NavigationTreeDefaultTabTable'].

You can add tables to this list or remove tables from it in database structure page by clicking on the star icons next to table names. Using $cfg['NumFavoriteTables'] you can configure the maximum number of favorite tables shown.

Without configuring the storage, you can still access the favorite tables, but it will disappear after you logout.

To allow the usage of this functionality persistently:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['table_uiprefs']
Type:

string or false

Default value:

''

Added in version 3.5.0.

BetterMyAdmin can be configured to remember several things (sorted column $cfg['RememberSorting'], column order, and column visibility from a database table) for browsing tables. Without configuring the storage, these features still can be used, but the values will disappear after you logout.

To allow the usage of these functionality persistently:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['users']
Type:

string or false

Default value:

''

The table used by BetterMyAdmin to store user name information for associating with user groups. See the next entry on $cfg['Servers'][$i]['usergroups'] for more details and the suggested settings.

$cfg['Servers'][$i]['usergroups']
Type:

string or false

Default value:

''

Added in version 4.1.0.

You can create different user groups with menu items attached to them. Users can be assigned to these groups and the logged in user would only see menu items configured to the usergroup they are assigned to. To do this it needs two tables “usergroups” (storing allowed menu items for each user group) and “users” (storing users and their assignments to user groups).

To allow the usage of this functionality:

This feature can be disabled by setting either of the configurations to false.

$cfg['Servers'][$i]['central_columns']
Type:

string or false

Default value:

''

Added in version 4.3.0.

You can have a central list of columns per database. You can add/remove columns to the list as per your requirement. These columns in the central list will be available to use while you create a new column for a table or create a table itself. You can select a column from central list while creating a new column, it will save you from writing the same column definition over again or from writing different names for similar column.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['designer_settings']
Type:

string or false

Default value:

''

Added in version 4.5.0.

Your designer settings can be remembered. Your choice regarding ‘Angular/Direct Links’, ‘Snap to Grid’, ‘Toggle Relation Lines’, ‘Small/Big All’, ‘Move Menu’ and ‘Pin Text’ can be remembered persistently.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['savedsearches']
Type:

string or false

Default value:

''

Added in version 4.2.0.

You can save and load query-by-example searches from the Database > Query panel.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['export_templates']
Type:

string or false

Default value:

''

Added in version 4.5.0.

You can save and load export templates.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['tracking']
Type:

string or false

Default value:

''

Added in version 3.3.x.

Since release 3.3.x a tracking mechanism is available. It helps you to track every SQL command which is executed by BetterMyAdmin. The mechanism supports logging of data manipulation and data definition statements. After enabling it you can create versions of tables.

The creation of a version has two effects:

  • BetterMyAdmin saves a snapshot of the table, including structure and indexes.

  • BetterMyAdmin logs all commands which change the structure and/or data of the table and links these commands with the version number.

Of course you can view the tracked changes. On the Tracking page a complete report is available for every version. For the report you can use filters, for example you can get a list of statements within a date range. When you want to filter usernames you can enter * for all names or you enter a list of names separated by ‘,’. In addition you can export the (filtered) report to a file or to a temporary database.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['tracking_version_auto_create']
Type:

boolean

Default value:

false

Whether the tracking mechanism creates versions for tables and views automatically.

If this is set to true and you create a table or view with

  • CREATE TABLE …

  • CREATE VIEW …

and no version exists for it, the mechanism will create a version for you automatically.

$cfg['Servers'][$i]['tracking_default_statements']
Type:

string

Default value:

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

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

$cfg['Servers'][$i]['tracking_add_drop_view']
Type:

boolean

Default value:

true

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

$cfg['Servers'][$i]['tracking_add_drop_table']
Type:

boolean

Default value:

true

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

$cfg['Servers'][$i]['tracking_add_drop_database']
Type:

boolean

Default value:

true

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

$cfg['Servers'][$i]['userconfig']
Type:

string or false

Default value:

''

Added in version 3.4.x.

BetterMyAdmin allows users to set most preferences by themselves and store them in the database.

If you don’t allow for storing preferences in $cfg['Servers'][$i]['pmadb'], users can still personalize BetterMyAdmin, but settings will be saved in browser’s local storage, or, it is is unavailable, until the end of session.

To allow the usage of this functionality:

This feature can be disabled by setting the configuration to false.

$cfg['Servers'][$i]['MaxTableUiprefs']
Type:

integer

Default value:

100

Maximum number of rows saved in $cfg['Servers'][$i]['table_uiprefs'] table.

When tables are dropped or renamed, $cfg['Servers'][$i]['table_uiprefs'] may contain invalid data (referring to tables which no longer exist). We only keep this number of newest rows in $cfg['Servers'][$i]['table_uiprefs'] and automatically delete older rows.

$cfg['Servers'][$i]['SessionTimeZone']
Type:

string

Default value:

''

Sets the time zone used by BetterMyAdmin. Leave blank to use the time zone of your database server. Possible values are explained at https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html

This is useful when your database server uses a time zone which is different from the time zone you want to use in BetterMyAdmin.

$cfg['Servers'][$i]['AllowRoot']
Type:

boolean

Default value:

true

Whether to allow root access. This is just a shortcut for the $cfg['Servers'][$i]['AllowDeny']['rules'] below.

$cfg['Servers'][$i]['AllowNoPassword']
Type:

boolean

Default value:

false

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]['AllowDeny']['order']
Type:

string

Default value:

''

If your rule order is empty, then IP authorization 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', authorization 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.

$cfg['Servers'][$i]['AllowDeny']['rules']
Type:

array of strings

Default value:

[]

The general format for the rules is as such:

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

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 (SERVER_ADDRESS is read from the SERVER_ADDR environment variable of the BetterMyAdmin process; without it, the localnet shortcuts match nothing):

'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 Address 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)

For IPv6 addresses, the following work:

  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (an exact IPv6 address)

  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz] (an IPv6 address range)

  • xxxx:xxxx:xxxx:xxxx/nn (CIDR, Classless Inter-Domain Routing type IPv6 addresses)

But the following does not work:

  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz] (partial IPv6 address range)

Examples:

Allow only ‘bob’ to connect from any host:

{ "Servers": [{ "AllowDeny": { "order": "allow,deny", "rules": ["allow bob from all"] } }] }

Allow only ‘mary’ to connect from host 192.168.100.50 through 192.168.100.100:

{ "Servers": [{ "AllowDeny": { "order": "allow,deny", "rules": ["allow mary from 192.168.100.[50-100]"] } }] }

Allow any user to connect from host 192.168.5.10 or 192.168.6.10:

{ "Servers": [{ "AllowDeny": { "order": "allow,deny", "rules": ["allow % from 192.168.[5-6].10"] } }] }

Allow any user to connect from 192.168.6.10, and additionally allow root to connect from 192.168.5.50:

{
  "Servers": [{
    "AllowDeny": {
      "order": "allow,deny",
      "rules": ["allow root from 192.168.5.50", "allow % from 192.168.6.10"]
    }
  }]
}
$cfg['Servers'][$i]['DisableIS']
Type:

boolean

Default value:

false

Disable using INFORMATION_SCHEMA to retrieve information (use SHOW commands instead), because of speed issues when many databases are present.

Note

Enabling this option might give you a big performance boost on older MySQL servers.

$cfg['Servers'][$i]['SignonScript']
Type:

string

Default value:

''

Added in version 3.5.0.

Path of a JavaScript or TypeScript module to be imported to obtain login credentials. This is alternative approach to session based single signon. The module has to export a function called getLoginCredentials which returns (or resolves to) a list of username and password, accepting single parameter of existing username (can be empty). A relative path is resolved against BetterMyAdmin’s working directory. See apps/server/examples/signon-script.ts for an example:

/**
 * `SignonScript` example: BetterMyAdmin imports this module and calls `getLoginCredentials(user)`
 * with the server's configured `user` on every page load; it returns `[user, password]` (or a
 * promise of it). An empty user redirects to SignonURL. The port of phpMyAdmin's
 * examples/signon-script.php (where the PHP function is `get_login_credentials`).
 *
 *   Servers: [{ auth_type: 'signon', SignonScript: './apps/server/examples/signon-script.ts', SignonURL: '…' }]
 *
 * A relative path is resolved against BetterMyAdmin's working directory. A `.ts` module needs a
 * TypeScript-aware Node (≥ 22.18 or tsx), a `.mjs` / `.js` one works everywhere.
 *
 * pma: examples/signon-script.php
 */
export function getLoginCredentials(user: string): [string, string] {
  // this would usually check the request (a header set by a reverse proxy, a ticket, …)
  return [user, process.env.SIGNON_PASSWORD ?? '']
}

Note

In phpMyAdmin this is a PHP file defining get_login_credentials(); BetterMyAdmin cannot run PHP, so the script has to be ported. A .ts module needs a TypeScript-aware Node.js (22.18 or later); a .mjs or .js module works everywhere.

$cfg['Servers'][$i]['SignonSession']
Type:

string

Default value:

''

Name of the cookie which will be used for signon authentication method. Takes effect only if $cfg['Servers'][$i]['SignonScript'] is not configured.

In phpMyAdmin this names the other application’s PHP session. BetterMyAdmin cannot read PHP sessions: the other application hands the credentials over in a cookie of this name holding the same PMA_single_signon_* keys, encrypted with a key derived from $cfg['blowfish_secret'] (see apps/server/examples/signon.ts). Login errors are written back into it (PMA_single_signon_error_message). The PMA_single_signon_token and PMA_single_signon_HMAC_secret keys have no use in BetterMyAdmin.

$cfg['Servers'][$i]['SignonCookieParams']
Type:

array

Default value:

[]

Added in version 4.7.0.

An object of cookie parameters of the $cfg['Servers'][$i]['SignonSession'] cookie, used when BetterMyAdmin rewrites it (for example to store a login error). Keys should include 'lifetime', 'path', 'domain', 'secure', 'httponly' or 'samesite'; they should be set to same values as the other application uses. Takes effect only if $cfg['Servers'][$i]['SignonScript'] is not configured.

$cfg['Servers'][$i]['SignonURL']
Type:

string

Default value:

''

URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol, or a path on BetterMyAdmin’s own host when $cfg['Servers'][$i]['SignonPage'] serves the login page.

$cfg['Servers'][$i]['SignonPage']
Type:

string

Default value:

''

BetterMyAdmin only. Path of a JavaScript module that BetterMyAdmin serves itself as the login page of a signon server, at the path of a same-host $cfg['Servers'][$i]['SignonURL'], before its login checks. A relative path is resolved against BetterMyAdmin’s working directory.

In phpMyAdmin the login page of a signon server is a PHP page that the same web server runs next to phpMyAdmin (examples/signon.php). BetterMyAdmin has no PHP and no separate web server, so this directive takes its place. The module exports a function (default or signonPage) that receives the request and a context with the current SignonSession data (session), sessionCookie(data) (the Set-Cookie value that stores the credentials, null clears them) and returnTo (the page the user asked for), and returns a Response. An external $cfg['Servers'][$i]['SignonURL'] keeps working without it.

{
  "Servers": [{
    "auth_type": "signon",
    "SignonSession": "SignonSession",
    "SignonURL": "/signon/",
    "LogoutURL": "/signon/?logout",
    "SignonPage": "./apps/server/examples/signon-page.mjs"
  }]
}
$cfg['Servers'][$i]['LogoutURL']
Type:

string

Default value:

''

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

$cfg['Servers'][$i]['hide_connection_errors']
Type:

boolean

Default value:

false

Added in version 4.9.8.

Whether to show or hide detailed MySQL/MariaDB connection errors on the login page.

Note

This error message can contain the target database server hostname or IP address, which may reveal information about your network to an attacker.

$cfg['Servers'][$i]['max_connections']
Type:

integer

Default value:

4

BetterMyAdmin only. The largest number of MySQL connections kept open for one session on this server. phpMyAdmin opens a new connection for every request; BetterMyAdmin keeps connections in a pool and reuses them (see $cfg['ConnectionPool']).

Generic settings

$cfg['DisableShortcutKeys']
Type:

boolean

Default value:

false

You can disable BetterMyAdmin shortcut keys by setting $cfg['DisableShortcutKeys'] to true.

$cfg['ServerDefault']
Type:

integer

Default value:

1

If you have more than one server configured, you can set $cfg['ServerDefault'] to any one of them to autoconnect to that server when BetterMyAdmin is started, or set it to 0 to be given a list of servers without logging in.

If you have only one server configured, $cfg['ServerDefault'] MUST be set to that server.

$cfg['VersionCheck']
Type:

boolean

Default value:

true

Enables check for latest versions using JavaScript on the main BetterMyAdmin page. BetterMyAdmin checks its own release feed (phpMyAdmin checks phpmyadmin.net); this and the error reports ($cfg['SendErrorReports']) are the only outbound network calls it makes.

$cfg['ProxyUrl']
Type:

string

Default value:

''

The url of the proxy to be used when BetterMyAdmin needs to access the outside internet such as when retrieving the latest version info or submitting error reports. You need this if the server where BetterMyAdmin is installed does not have direct access to the internet. The format is: “hostname:portnumber”

$cfg['ProxyUser']
Type:

string

Default value:

''

The username for authenticating with the proxy. By default, no authentication is performed. If a username is supplied, Basic Authentication will be performed. No other types of authentication are currently supported.

$cfg['ProxyPass']
Type:

string

Default value:

''

The password for authenticating with the proxy.

$cfg['MaxDbList']
Type:

integer

Default value:

100

The maximum number of database names to be displayed in the main panel’s database list.

$cfg['MaxTableList']
Type:

integer

Default value:

250

The maximum number of table names to be displayed in the main panel’s list (except on the Export page).

$cfg['MaxRoutineList']
Type:

integer

Default value:

250

The maximum number of routine names to be displayed in the main panel’s routine list.

$cfg['ShowHint']
Type:

boolean

Default value:

true

Whether or not to show hints (for example, hints when hovering over table headers).

$cfg['MaxCharactersInDisplayedSQL']
Type:

integer

Default value:

1000

The maximum number of characters when a SQL query is displayed. The default limit of 1000 should be correct to avoid the display of tons of hexadecimal codes that represent BLOBs, but some users have real SQL queries that are longer than 1000 characters. Also, if a query’s length exceeds this limit, this query is not saved in the history.

$cfg['PersistentConnections']
Type:

boolean

Default value:

false

In phpMyAdmin, whether PHP’s persistent MySQL connections should be used or not.

Note

This directive has no effect in BetterMyAdmin: it is a PHP feature. BetterMyAdmin always keeps MySQL connections in a pool and reuses them between requests (see $cfg['ConnectionPool'] and $cfg['Servers'][$i]['max_connections']). The directive is accepted in the configuration but no settings form lists it.

$cfg['ForceSSL']
Type:

boolean

Default value:

false

Deprecated since version 4.6.0: This setting is no longer available since phpMyAdmin 4.6.0, which asks you to adjust your web server instead. BetterMyAdmin honours it.

Whether to force using https while accessing BetterMyAdmin. When true, plain HTTP requests are redirected to HTTPS, a Strict-Transport-Security (HSTS) header is sent and the cookies are marked Secure.

Note

Behind a TLS-terminating reverse proxy or load balancer, the proxy must send an X-Forwarded-Proto: https header so that BetterMyAdmin sees that the original request used HTTPS, and you might have to set $cfg['PmaAbsoluteUri'] for correct redirection.

$cfg['MysqlSslWarningSafeHosts']
Type:

array [list of non-empty strings]

Default value:

['127.0.0.1', 'localhost']

Added in version 5.1.0.

This search is case-sensitive and will match the exact string only. If your setup does not use SSL but is safe because you are using a local connection or private network, you can add your hostname or IP to the list. You can also remove the default entries to only include yours.

This check uses the value of $cfg['Servers'][$i]['host'].

Example configuration:

{ "MysqlSslWarningSafeHosts": ["127.0.0.1", "::1", "mariadb.local"] }
$cfg['ExecTimeLimit']
Type:

integer [number of seconds]

Default value:

300

Set the number of seconds an import is allowed to run. If seconds is set to zero, no time limit is imposed. With “Allow interruption” (the allow_interrupt key of $cfg['Import']) the import stops a few seconds before the limit and can be resumed, as in phpMyAdmin. The Docker variable MAX_EXECUTION_TIME sets it.

Note

In phpMyAdmin this is PHP’s time limit, which ends any request, exports included. BetterMyAdmin applies it to imports only: other requests, exports included, have no time limit and stream their output.

$cfg['SessionSavePath']
Type:

string

Default value:

''

In phpMyAdmin, the path for storing PHP session data (the session.save_path PHP parameter).

Note

This directive has no effect in BetterMyAdmin, which has no PHP sessions: sessions are kept in sessions.sqlite in $cfg['DataDir']. Keep that directory private.

$cfg['MemoryLimit']
Type:

string [number of bytes]

Default value:

'-1'

In phpMyAdmin, the number of bytes a PHP script is allowed to allocate ('-1': no limit). You can use a string with a suffix, eg. '16M'. Ensure you don’t omit the suffix (16 means 16 bytes!) The Docker variable MEMORY_LIMIT sets it.

Note

BetterMyAdmin has no per-request memory limit: it uses this value only to size the chunks an import reads (an eighth of it), as phpMyAdmin does. Exports and other requests stream in bounded memory.

$cfg['SkipLockedTables']
Type:

boolean

Default value:

false

Mark used tables and make it possible to show databases with locked tables (since MySQL 3.23.30).

$cfg['ShowSQL']
Type:

boolean

Default value:

true

Defines whether SQL queries generated by BetterMyAdmin should be displayed or not.

$cfg['RetainQueryBox']
Type:

boolean

Default value:

false

Defines whether the SQL query box should be kept displayed after its submission.

$cfg['CodemirrorEnable']
Type:

boolean

Default value:

true

Defines whether to use a Javascript code editor for SQL query boxes. CodeMirror provides syntax highlighting and line numbers. However, middle-clicking for pasting the clipboard contents in some Linux distributions (such as Ubuntu) is not supported by all browsers.

$cfg['LintEnable']
Type:

boolean

Default value:

true

Added in version 4.5.0.

Defines whether to use the parser to find any errors in the query before executing.

$cfg['DefaultForeignKeyChecks']
Type:

string

Default value:

'default'

Default value of the checkbox for foreign key checks, to disable/enable foreign key checks for certain queries. The possible values are 'default', 'enable' or 'disable'. If set to 'default', the value of the MySQL variable FOREIGN_KEY_CHECKS is used.

$cfg['AllowUserDropDatabase']
Type:

boolean

Default value:

false

Warning

This is not a security measure as there will be always ways to circumvent this. If you want to prohibit users from dropping databases, revoke their corresponding DROP privilege.

Defines whether normal users (non-administrator) are allowed to delete their own database or not. If set as false, the link Drop Database will not be shown, and even a DROP DATABASE mydatabase will be rejected. Quite practical for ISP ‘s with many customers.

This limitation of SQL queries is not as strict as when using MySQL privileges. This is due to nature of SQL queries which might be quite complicated. So this choice should be viewed as help to avoid accidental dropping rather than strict privilege limitation.

$cfg['Confirm']
Type:

boolean

Default value:

true

Whether a warning (“Are your really sure…”) should be displayed when you’re about to lose data.

$cfg['UseDbSearch']
Type:

boolean

Default value:

true

Define whether the “search string inside database” is enabled or not.

$cfg['IgnoreMultiSubmitErrors']
Type:

boolean

Default value:

false

Define whether BetterMyAdmin will continue executing a multi-query statement if one of the queries fails. Default is to abort execution.

$cfg['enable_drag_drop_import']
Type:

boolean

Default value:

true

Whether or not the drag and drop import feature is enabled. When enabled, a user can drag a file in to their browser and BetterMyAdmin will attempt to import the file.

$cfg['URLQueryEncryption']
Type:

boolean

Default value:

false

Added in version 4.9.8.

Define whether BetterMyAdmin will encrypt sensitive data (like database name and table name) from the URL query string. Default is to not encrypt the URL query string.

$cfg['URLQueryEncryptionSecretKey']
Type:

string

Default value:

''

Added in version 4.9.8.

A secret key used to encrypt/decrypt the URL query string. Should be 32 bytes long.

$cfg['maxRowPlotLimit']
Type:

integer

Default value:

500

Maximum number of rows retrieved for zoom search.

Main panel

$cfg['ShowStats']
Type:

boolean

Default value:

true

Defines whether or not to display space usage and statistics about databases and tables.

$cfg['ShowServerInfo']
Type:

boolean|string

Default value:

true

Defines whether to display detailed server information on main page. Possible values are:

  • true to show all server information

  • false to hide server information

  • 'database-server' to show only database server information

  • 'web-server' to show only web server information (in BetterMyAdmin, the Node.js server and runtime)

You can additionally hide more information by using $cfg['Servers'][$i]['verbose'].

Changed in version 6.0.0: Added 'database-server' and 'web-server' options.

$cfg['ShowPhpInfo']
Type:

boolean

Default value:

false

Defines whether to display the Show runtime information link or not at the starting main (right) frame.

In phpMyAdmin this links to PHP’s phpinfo() page. BetterMyAdmin has no PHP: the link opens a “Runtime info” page instead (Node.js version, platform and a summary of the configuration).

Warning

Enabling this page will leak information about the server setup. Is it not recommended to enable this on shared installations.

This might also make easier some remote attacks on your installations, so enable this only when needed.

$cfg['ShowChgPassword']
Type:

boolean

Default value:

true

Defines whether to display the Change password link or not at the starting main (right) frame. This setting does not check MySQL commands entered directly.

Please note that enabling the Change password link has no effect with config authentication mode: because of the hard coded password value in the configuration file, end users can’t be allowed to change their passwords.

$cfg['ShowCreateDb']
Type:

boolean

Default value:

true

Defines whether to display the form for creating database or not at the starting main (right) frame. This setting does not check MySQL commands entered directly.

$cfg['ShowGitRevision']
Type:

boolean

Default value:

true

Defines whether to display information about the current Git revision (if applicable) on the main panel.

$cfg['MysqlMinVersion']
Type:

array

Default value:

{"internal": 50500, "human": "5.5.0"}

Defines the minimum supported MySQL version: internal is the version as a number, human as shown to the user. The default (5.5.0) is phpMyAdmin’s; the directive was asked by a developer of the Plesk control panel to ease integration with older MySQL servers (where most of the features work).

Database structure

$cfg['ShowDbStructureCharset']
Type:

boolean

Default value:

false

Defines whether to show a column displaying the charset for all tables in the database structure page.

$cfg['ShowDbStructureComment']
Type:

boolean

Default value:

false

Defines whether to show a column displaying the comments for all tables in the database structure page.

$cfg['ShowDbStructureCreation']
Type:

boolean

Default value:

false

Defines whether the database structure page (tables list) has a “Creation” column that displays when each table was created.

$cfg['ShowDbStructureLastUpdate']
Type:

boolean

Default value:

false

Defines whether the database structure page (tables list) has a “Last update” column that displays when each table was last updated.

$cfg['ShowDbStructureLastCheck']
Type:

boolean

Default value:

false

Defines whether the database structure page (tables list) has a “Last check” column that displays when each table was last checked.

$cfg['HideStructureActions']
Type:

boolean

Default value:

true

Defines whether the table structure actions are hidden under a “More” drop-down.

$cfg['ShowColumnComments']
Type:

boolean

Default value:

true

Defines whether to show column comments as a column in the table structure view.

Browse mode

$cfg['TableNavigationLinksMode']
Type:

string

Default value:

'icons'

Defines whether the table navigation links contain 'icons', 'text' or 'both'.

$cfg['ActionLinksMode']
Type:

string

Default value:

'both'

If set to icons, will display icons instead of text for db and table properties links (like Browse, Select, Insert, …). Can be set to 'both' if you want icons AND text. When set to text, will only show text.

$cfg['RowActionType']
Type:

string

Default value:

'both'

Whether to display icons or text or both icons and text in table row action segment. Value can be either of 'icons', 'text' or 'both'.

$cfg['ShowAll']
Type:

boolean

Default value:

false

Defines whether a user should be displayed a “Show all” button in browse mode or not in all cases. By default it is shown only on small tables (less than 500 rows) to avoid performance issues while getting too many rows.

$cfg['MaxRows']
Type:

integer

Default value:

25

Number of rows displayed when browsing a result set and no LIMIT clause is used. If the result set contains more rows, “Previous” and “Next” links will be shown. Possible values: 25,50,100,250,500.

$cfg['Order']
Type:

string

Default value:

'SMART'

Defines whether columns are displayed in ascending (ASC) order, in descending (DESC) order or in a “smart” (SMART) order - I.E. descending order for columns of type TIME, DATE, DATETIME and TIMESTAMP, ascending order else- by default.

Changed in version 3.4.0: Since phpMyAdmin 3.4.0 the default value is 'SMART'.

$cfg['DisplayBinaryAsHex']
Type:

boolean

Default value:

true

Defines whether the “Show binary contents as HEX” browse option is ticked by default.

Added in version 3.3.0.

Deprecated since version 4.3.0: This setting was removed.

$cfg['GridEditing']
Type:

string

Default value:

'double-click'

Defines which action (double-click or click) triggers grid editing. Can be deactivated with the disabled value.

$cfg['RelationalDisplay']
Type:

string

Default value:

'K'

Defines the initial behavior for Options > Relational. K, which is the default, displays the key while D shows the display column.

$cfg['SaveCellsAtOnce']
Type:

boolean

Default value:

false

Defines whether or not to save all edited cells at once for grid editing.

Editing mode

$cfg['ProtectBinary']
Type:

boolean or string

Default value:

'blob'

Defines whether BLOB or BINARY columns are protected from editing when browsing a table’s content. Valid values are:

  • false to allow editing of all columns;

  • 'blob' to allow editing of all columns except BLOBS;

  • 'noblob' to disallow editing of all columns except BLOBS (the opposite of 'blob');

  • 'all' to disallow editing of all BINARY or BLOB columns.

$cfg['ShowFunctionFields']
Type:

boolean

Default value:

true

Defines whether or not MySQL functions fields should be initially displayed in edit/insert mode. Since version 2.10, the user can toggle this setting from the interface.

$cfg['ShowFieldTypesInDataEditView']
Type:

boolean

Default value:

true

Defines whether or not type fields should be initially displayed in edit/insert mode. The user can toggle this setting from the interface.

$cfg['InsertRows']
Type:

integer

Default value:

2

Defines the default number of rows to be entered from the Insert page. Users can manually change this from the bottom of that page to add or remove blank rows.

$cfg['ForeignKeyMaxLimit']
Type:

integer

Default value:

100

If there are fewer items than this in the set of foreign keys, then a drop-down box of foreign keys is presented, in the style described by the $cfg['ForeignKeyDropdownOrder'] setting.

$cfg['ForeignKeyDropdownOrder']
Type:

array

Default value:

['content-id', 'id-content']

For the foreign key drop-down fields, there are several methods of display, offering both the key and value data. The contents of the array should be one or both of the following strings: content-id, id-content.

Export and import settings

$cfg['ZipDump']
Type:

boolean

Default value:

true

$cfg['GZipDump']
Type:

boolean

Default value:

true

$cfg['BZipDump']
Type:

boolean

Default value:

true

Defines whether to allow the use of zip/GZip/BZip2 compression when creating a dump file

$cfg['CompressOnFly']
Type:

boolean

Default value:

true

Defines whether to allow on the fly compression for GZip compressed exports: the output is compressed in chunks, so produced files contain more GZip headers, but all normal programs handle this correctly.

Note

In phpMyAdmin this lets larger dumps fit in PHP’s memory limit. BetterMyAdmin always streams exports, compressed or not, so memory is not a concern either way.

$cfg['Export']
Type:

array

Default value:

[...]

In this array are defined default parameters for export, names of items are similar to texts seen on export page, so you can easily identify what they mean.

$cfg['Export']['format']
Type:

string

Default value:

'sql'

Default export format. Besides phpMyAdmin’s formats, 'jsmodule' selects BetterMyAdmin’s “JavaScript module” format, which replaces phpMyAdmin’s “PHP array” ('phparray' is accepted and falls back to 'sql').

$cfg['Export']['method']
Type:

string

Default value:

'quick'

Defines how the export form is displayed when it loads. Valid values are:

  • quick to display the minimum number of options to configure

  • custom to display every available option to configure

  • custom-no-form same as custom but does not display the option of using quick export

$cfg['Export']['compression']
Type:

string

Default value:

'none'

Default export compression method. Possible values are 'none', 'zip' or 'gzip'.

$cfg['Export']['charset']
Type:

string

Default value:

''

Defines charset for generated export. By default no charset conversion is done assuming UTF-8.

$cfg['Export']['file_template_table']
Type:

string

Default value:

'@TABLE@'

Default filename template for table exports.

$cfg['Export']['file_template_database']
Type:

string

Default value:

'@DATABASE@'

Default filename template for database exports.

$cfg['Export']['file_template_server']
Type:

string

Default value:

'@SERVER@'

Default filename template for server exports.

$cfg['Export']['remove_definer_from_definitions']
Type:

boolean

Default value:

false

Remove DEFINER clause from the event, view and routine definitions.

Added in version 5.2.0.

$cfg['Export']['csv_escape_formulas']
Type:

boolean

Default value:

false

BetterMyAdmin only. When enabled, CSV and CSV for MS Excel cells starting with =, +, - or @ are escaped, so that a spreadsheet does not run them as formulas (CSV injection). It is off by default to produce the same files as phpMyAdmin, which never escapes them.

$cfg['Export']['jsmodule_structure_or_data']
Type:

string

Default value:

'data'

BetterMyAdmin only. What the “JavaScript module” export contains by default: 'structure', 'data' or 'structure_and_data'. This format takes the place of phpMyAdmin’s “PHP array” export (whose phparray_structure_or_data is accepted and has no use): each table becomes export const <table> = [{…}] in a .js file, values as JSON strings and binary or geometry values in hexadecimal.

$cfg['Import']
Type:

array

Default value:

[...]

In this array are defined default parameters for import, names of items are similar to texts seen on import page, so you can easily identify what they mean.

$cfg['Import']['charset']
Type:

string

Default value:

''

Defines charset for import. By default no charset conversion is done assuming UTF-8.

$cfg['Import']['MaxDecompressedSize']
Type:

integer [number of bytes]

Default value:

0

BetterMyAdmin only. The largest size a compressed import file (gzip, bzip2, zip) may decompress to; a larger output stops the import, which protects against “zip bombs”. 0 means ten times $cfg['MaxUploadSize'].

$cfg['Schema']
Type:

array

Default value:

[...]

$cfg['Schema']['format']
Type:

string

Default value:

'pdf'

Defines the default format for schema export. Possible values are 'pdf', 'eps', 'dia' or 'svg'.

The PDF schema needs no TCPDF: BetterMyAdmin draws the same document itself, with the DejaVu Sans font embedded.

Tabs display settings

$cfg['TabsMode']
Type:

string

Default value:

'both'

Defines whether the menu tabs contain 'icons', 'text' or 'both'.

$cfg['PropertiesNumColumns']
Type:

integer

Default value:

1

How many columns will be utilized to display the tables on the database property view? When setting this to a value larger than 1, the type of the database will be omitted for more display space.

$cfg['DefaultTabServer']
Type:

string

Default value:

'welcome'

Defines the tab displayed by default on server view. The possible values are:

  • welcome (recommended for multi-user setups)

  • databases,

  • status

  • variables

  • privileges

$cfg['DefaultTabDatabase']
Type:

string

Default value:

'structure'

Defines the tab displayed by default on database view. The possible values are:

  • structure

  • sql

  • search

  • operations

$cfg['DefaultTabTable']
Type:

string

Default value:

'browse'

Defines the tab displayed by default on table view. The possible values are:

  • structure

  • sql

  • search

  • insert

  • browse

PDF Options

$cfg['PDFPageSizes']
Type:

array

Default value:

['A3', 'A4', 'A5', 'letter', 'legal']

Array of possible paper sizes for creating PDF pages.

You should never need to change this.

$cfg['PDFDefaultPageSize']
Type:

string

Default value:

'A4'

Default page size to use when creating PDF pages. Valid values are any listed in $cfg['PDFPageSizes'].

Languages

$cfg['DefaultLang']
Type:

string

Default value:

'en'

Defines the default language to use, if not browser-defined or user- defined. It must be one of the languages BetterMyAdmin ships (phpMyAdmin’s translations, built into the application).

$cfg['DefaultConnectionCollation']
Type:

string

Default value:

'utf8mb4_general_ci'

Defines the default connection collation to use, if not user-defined. See the MySQL documentation for charsets for list of possible values.

$cfg['Lang']
Type:

string

Default value:

not set

Force language to use. It must be one of the languages BetterMyAdmin ships.

$cfg['FilterLanguages']
Type:

string

Default value:

''

Limit list of available languages to those matching the given regular expression. For example if you want only Czech and English, you should set filter to '^(cs|en)'.

$cfg['RecodingEngine']
Type:

string

Default value:

'auto'

You can select here which functions will be used for character set conversion. Possible values are:

  • 'auto' - automatically use available one (first is tested iconv, then mbstring)

  • 'iconv' - use iconv or libiconv functions

  • 'mb' - use mbstring extension

  • 'none' - disable encoding conversion

BetterMyAdmin has no PHP extensions: every value converts with the same built-in converter, which follows iconv’s behaviour (including $cfg['IconvExtraParams']). As in phpMyAdmin, 'none' still converts. A character that cannot be converted ends the export or import with an error message (phpMyAdmin stops with a PHP error).

Enabled charset conversion activates a pull-down menu in the Export and Import pages, to choose the character set when exporting a file. The default value in this menu comes from $cfg['Export']['charset'] and $cfg['Import']['charset'].

Changed in version 6.0.0: Support for the Recode extension has been removed. The 'recode' value is ignored and the default value ('auto') is used instead.

$cfg['IconvExtraParams']
Type:

string

Default value:

'//TRANSLIT'

Specify some parameters for iconv used in charset conversion. See iconv documentation for details. By default //TRANSLIT is used, so that invalid characters will be transliterated.

$cfg['AvailableCharsets']
Type:

array [list of strings]

Default value:

[...]

Available character sets for MySQL conversion. You can add your own (any of supported by iconv) or remove these which you don’t use. Character sets will be shown in same order as here listed, so if you frequently use some of these move them to the top.

Example configuration:

{ "AvailableCharsets": ["utf-8", "iso-8859-1"] }

Web server settings

These settings concern the HTTP server built into BetterMyAdmin; there is no separate web server to configure.

$cfg['OBGzip']
Type:

string/boolean

Default value:

'auto'

Defines whether to use GZip output buffering for increased speed in HTTP transfers. Set to true/false for enabling/disabling. When set to ‘auto’ (string), BetterMyAdmin tries to enable output buffering and will automatically disable it if your browser has some problems with buffering. IE6 with a certain patch is known to cause data corruption when having enabled buffering.

Deprecated since version 6.0.0: This setting was removed.

$cfg['TrustedProxies']
Type:

array

Default value:

[]

Lists proxies and HTTP headers which are trusted for $cfg['Servers'][$i]['AllowDeny']['order']. This list is by default empty, you need to fill in some trusted proxy servers if you want to use rules for IP addresses behind proxy.

The following example specifies that BetterMyAdmin should trust a HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy 1.2.3.4:

{ "TrustedProxies": { "1.2.3.4": "HTTP_X_FORWARDED_FOR" } }

The $cfg['Servers'][$i]['AllowDeny']['rules'] directive uses the client’s IP address as usual.

$cfg['GD2Available']
Type:

string

Default value:

'auto'

Specifies whether GD >= 2 is available. If yes it can be used for MIME transformations. Possible values are:

  • auto - automatically detect

  • yes - GD 2 functions can be used

  • no - GD 2 function cannot be used

BetterMyAdmin does not use the PHP GD extension: thumbnails are resized by built-in code that reproduces GD’s resampling, so auto and yes both mean available. With no, the inline image transformations show the original image instead of a resized thumbnail.

$cfg['CheckConfigurationPermissions']
Type:

boolean

Default value:

true

We normally check the permissions on the configuration file to ensure it’s not world writable: a world-writable file stops every request with an error. However, the configuration file could be on a NTFS filesystem mounted on a non-Windows server, in which case the permissions seems wrong but in fact cannot be detected. In this case a sysadmin would set this parameter to false.

$cfg['LinkLengthLimit']
Type:

integer

Default value:

1000

Limit for length of URL in links. When length would be above this limit, it is replaced by form with button. This is required as some web servers (IIS) have problems with long URL.

Note

This directive has no effect in BetterMyAdmin, whose pages keep their parameters in the path and in request bodies rather than in long URLs.

$cfg['CSPAllow']
Type:

string

Default value:

''

Additional string to include in allowed script and image sources in Content Security Policy header.

This can be useful when you want to load some external resources (for example a logo link target, see $cfg['NavigationLogoLinkWindow']), which would be normally not allowed by Content Security Policy.

To allow some sites, just list them within the string:

{ "CSPAllow": "example.com example.net" }

Added in version 4.0.4.

$cfg['DisableMultiTableMaintenance']
Type:

boolean

Default value:

false

In the database Structure page, it’s possible to mark some tables then choose an operation like optimizing for many tables. This can slow down a server; therefore, setting this to true prevents this kind of multiple maintenance operation.

Theme settings

BetterMyAdmin’s themes are sets of design tokens built into the application, not theme folders with SCSS files: there is nothing to edit on the server. See Custom Themes and $cfg['ThemeDefault'].

Design customization

$cfg['NavigationTreePointerEnable']
Type:

boolean

Default value:

true

When set to true, hovering over an item in the navigation panel causes that item to be marked (the background is highlighted).

$cfg['BrowsePointerEnable']
Type:

boolean

Default value:

true

When set to true, hovering over a row in the Browse page causes that row to be marked (the background is highlighted).

$cfg['BrowseMarkerEnable']
Type:

boolean

Default value:

true

When set to true, a data row is marked (the background is highlighted) when the row is selected with the checkbox.

$cfg['LimitChars']
Type:

integer

Default value:

50

Maximum number of characters shown in any non-numeric field on browse view. Can be turned off by a toggle button on the browse page.

Type:

string

Default value:

'left'

Defines the place where table row links (Edit, Copy, Delete) would be put when tables contents are displayed (you may have them displayed at the left side, right side, both sides or nowhere).

$cfg['RowActionLinksWithoutUnique']
Type:

boolean

Default value:

false

Defines whether to show row links (Edit, Copy, Delete) and checkboxes for multiple row operations even when the selection does not have a unique key. Using row actions in the absence of a unique key may result in different/more rows being affected since there is no guaranteed way to select the exact row(s).

$cfg['RememberSorting']
Type:

boolean

Default value:

true

If enabled, remember the sorting of each table when browsing them.

$cfg['TablePrimaryKeyOrder']
Type:

string

Default value:

'NONE'

This defines the default sort order for the tables, having a primary key, when there is no sort order defines externally. Possible values are:

  • NONE

  • ASC

  • DESC

$cfg['ShowBrowseComments']
Type:

boolean

Default value:

true

$cfg['ShowPropertyComments']
Type:

boolean

Default value:

true

By setting the corresponding variable to true you can enable the display of column comments in Browse or Property display. In browse mode, the comments are shown inside the header. In property mode, comments are displayed using a CSS-formatted dashed-line below the name of the column. The comment is shown as a tool-tip for that column.

$cfg['FirstDayOfCalendar']
Type:

integer

Default value:

0

This will define the first day of week in the calendar. The number can be set from 0 to 6, which represents the seven days of the week, Sunday to Saturday respectively. This value can also be configured by the user in Settings -> Features -> General -> First day of calendar field.

Text fields

$cfg['CharEditing']
Type:

string

Default value:

'input'

Defines which type of editing controls should be used for CHAR and VARCHAR columns. Applies to data editing and also to the default values in structure editing. Possible values are:

  • input - this allows to limit size of text to size of columns in MySQL, but has problems with newlines in columns

  • textarea - no problems with newlines in columns, but also no length limitations

$cfg['MinSizeForInputField']
Type:

integer

Default value:

4

Defines the minimum size for input fields generated for CHAR and VARCHAR columns.

$cfg['MaxSizeForInputField']
Type:

integer

Default value:

60

Defines the maximum size for input fields generated for CHAR and VARCHAR columns.

$cfg['TextareaCols']
Type:

integer

Default value:

40

$cfg['TextareaRows']
Type:

integer

Default value:

15

$cfg['CharTextareaCols']
Type:

integer

Default value:

40

$cfg['CharTextareaRows']
Type:

integer

Default value:

7

Number of columns and rows for the textareas. This value will be emphasized (*2) for SQL query textareas and (*1.25) for SQL textareas inside the query window.

The Char* values are used for CHAR and VARCHAR editing (if configured via $cfg['CharEditing']).

Changed in version 5.0.0: The default value was changed from 2 to 7.

$cfg['LongtextDoubleTextarea']
Type:

boolean

Default value:

true

Defines whether textarea for LONGTEXT columns should have double size.

$cfg['TextareaAutoSelect']
Type:

boolean

Default value:

false

Defines if the whole textarea of the query box will be selected on click.

$cfg['EnableAutocompleteForTablesAndColumns']
Type:

boolean

Default value:

true

Whether to enable autocomplete for table and column names in any SQL query box.

SQL query box settings

$cfg['SQLQuery']['Edit']
Type:

boolean

Default value:

true

Whether to display an edit link to change a query in any SQL Query box.

$cfg['SQLQuery']['Explain']
Type:

boolean

Default value:

true

Whether to display a link to explain a SELECT query in any SQL Query box.

$cfg['SQLQuery']['ShowAsPHP']
Type:

boolean

Default value:

true

Whether to display a link to wrap a query in code in any SQL Query box. In BetterMyAdmin the link is “Create JS code”: it shows the query as JavaScript string literals (phpMyAdmin’s “Create PHP code”); the directive keeps its phpMyAdmin name.

$cfg['SQLQuery']['Refresh']
Type:

boolean

Default value:

true

Whether to display a link to refresh a query in any SQL Query box.

Upload/save/import directories

These directories are on the machine (or in the container) where BetterMyAdmin runs, and are read and written by the user running BetterMyAdmin (node in the Docker image, where the PMA_UPLOADDIR and PMA_SAVEDIR variables set them). BetterMyAdmin serves only its own application files over HTTP, never these directories, and it lists and reads only the files inside them (paths that point outside are refused). Still, give them the strictest permissions you can, as they may hold complete database dumps.

$cfg['UploadDir']
Type:

string

Default value:

''

The name of the directory where SQL files have been uploaded by other means than BetterMyAdmin (for example, FTP). Those files are available under a drop-down box when you click the database or table name, then the Import tab.

If you want different directory for each user, %u will be replaced with username.

Please note that the file names must have the suffix “.sql” (or “.sql.bz2” or “.sql.gz” if support for compressed formats is enabled).

This feature is useful when your file is too big to be uploaded via HTTP (see $cfg['MaxUploadSize']).

Warning

Please see top of this chapter (Upload/save/import directories) for instructions how to setup this directory and how to make its usage secure.

$cfg['SaveDir']
Type:

string

Default value:

''

The name of the directory on the server where exported files can be saved.

If you want a different directory for each user, %u will be replaced with the username.

Please note that the directory must exist and has to be writable for the user running BetterMyAdmin.

Warning

Please see top of this chapter (Upload/save/import directories) for instructions how to setup this directory and how to make its usage secure.

$cfg['TempDir']
Type:

string

Default value:

'./tmp/'

In phpMyAdmin, the name of the directory where temporary files can be stored (the templates cache, ESRI Shapefiles import, uploaded files under open_basedir).

Note

BetterMyAdmin has no template cache and does not keep its temporary files there: an uploaded import file is staged in a private bma-import subdirectory of the system temporary directory (created with mode 0700, files 0600 with random names, pruned after a while). The setup script still shows phpMyAdmin’s notice when this directive is set; otherwise it has no effect.

Various display setting

$cfg['RepeatCells']
Type:

integer

Default value:

100

Repeat the headers every X cells, or 0 to deactivate.

$cfg['EditInWindow']
Type:

boolean

Default value:

true

Deprecated since version 4.3.0: This setting was removed.

$cfg['QueryWindowWidth']
Type:

integer

Default value:

550

Deprecated since version 4.3.0: This setting was removed.

$cfg['QueryWindowHeight']
Type:

integer

Default value:

310

Deprecated since version 4.3.0: This setting was removed.

$cfg['QueryHistoryDB']
Type:

boolean

Default value:

false

$cfg['QueryWindowDefTab']
Type:

string

Default value:

'sql'

Deprecated since version 4.3.0: This setting was removed.

$cfg['QueryHistoryMax']
Type:

integer

Default value:

25

If $cfg['QueryHistoryDB'] is set to true, all your Queries are logged to a table, which has to be created by you (see $cfg['Servers'][$i]['history']). If set to false, all your queries will be appended to the form, but only as long as your window is opened they remain saved.

When using the JavaScript based query window, it will always get updated when you click on a new table/db to browse and will focus if you click on Edit SQL after using a query. You can suppress updating the query window by checking the box Do not overwrite this query from outside the window below the query textarea. Then you can browse tables/databases in the background without losing the contents of the textarea, so this is especially useful when composing a query with tables you first have to look in. The checkbox will get automatically checked whenever you change the contents of the textarea. Please uncheck the button whenever you definitely want the query window to get updated even though you have made alterations.

If $cfg['QueryHistoryDB'] is set to true you can specify the amount of saved history items using $cfg['QueryHistoryMax'].

$cfg['AllowSharedBookmarks']
Type:

boolean

Default value:

true

Added in version 6.0.0.

Allow users to create bookmarks that are available for all other users

$cfg['BrowseMIME']
Type:

boolean

Default value:

true

Enable Transformations.

$cfg['MaxExactCount']
Type:

integer

Default value:

50000

For InnoDB tables, determines for how large tables BetterMyAdmin should get the exact row count using SELECT COUNT. If the approximate row count as returned by SHOW TABLE STATUS is smaller than this value, SELECT COUNT will be used, otherwise the approximate count will be used.

Changed in version 4.8.0: The default value was lowered to 50000 for performance reasons.

Changed in version 4.2.6: The default value was changed to 500000.

$cfg['MaxExactCountViews']
Type:

integer

Default value:

0

For VIEWs, since obtaining the exact count could have an impact on performance, this value is the maximum to be displayed, using a SELECT COUNT ... LIMIT. Setting this to 0 bypasses any row counting.

$cfg['NaturalOrder']
Type:

boolean

Default value:

true

Sorts database, table names and foreign key constaint according to natural order (for example, t1, t2, t10). Currently implemented in the navigation panel, in Database view for the table list and Relation view while listing Foreign key constraints.

$cfg['InitialSlidersState']
Type:

string

Default value:

'closed'

If set to 'closed', the visual sliders are initially in a closed state. A value of 'open' does the reverse. To completely disable all visual sliders, use 'disabled'.

$cfg['UserprefsDisallow']
Type:

array

Default value:

[]

Contains names of configuration options (keys of the configuration) that users can’t set through user preferences. For possible values, refer to the user preference forms in packages/config/src/forms.ts (phpMyAdmin’s src/Config/Forms/User/).

$cfg['UserprefsDeveloperTab']
Type:

boolean

Default value:

false

Added in version 3.4.0.

Activates in the user preferences a tab containing options for developers of BetterMyAdmin.

Page titles

The page title displayed by your browser’s window or tab title bar can be customized. You can use 6.27 What format strings can I use?. The following four options allow customizing various parts of the BetterMyAdmin interface. Note that the login page title cannot be changed.

$cfg['TitleTable']
Type:

string

Default value:

'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'

$cfg['TitleDatabase']
Type:

string

Default value:

'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'

$cfg['TitleServer']
Type:

string

Default value:

'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'

$cfg['TitleDefault']
Type:

string

Default value:

'@HTTP_HOST@ | @PHPMYADMIN@'

In BetterMyAdmin, @PHPMYADMIN@ is replaced by “BetterMyAdmin” and its version.

Theme manager settings

$cfg['ThemeManager']
Type:

boolean

Default value:

true

Enables user-selectable themes. See 2.7 Using and creating themes.

$cfg['ThemeDefault']
Type:

string

Default value:

'pmahomme'

The default theme: one of pmahomme, original, metro and bootstrap (phpMyAdmin’s themes), or modern, classic and native (BetterMyAdmin’s own). An unknown name falls back to pmahomme. See Custom Themes.

$cfg['ThemePerServer']
Type:

boolean

Default value:

false

Whether to allow different theme for each server.

$cfg['FontSize']
Type:

string

Default value:

‘82%’

Deprecated since version 5.0.0: This setting was removed as the browser is more efficient, thus no need of this option.

Font size to use, is applied in CSS.

Default queries

$cfg['DefaultQueryTable']
Type:

string

Default value:

'SELECT * FROM @TABLE@ WHERE 1'

$cfg['DefaultQueryDatabase']
Type:

string

Default value:

''

Default queries that will be displayed in query boxes when user didn’t specify any. You can use standard 6.27 What format strings can I use?.

MySQL settings

$cfg['DefaultFunctions']
Type:

array

Default value:

['FUNC_CHAR' => '', 'FUNC_DATE' => '', 'FUNC_NUMBER' => '', 'FUNC_SPATIAL' => 'GeomFromText', 'FUNC_UUID' => 'UUID', 'first_timestamp' => 'NOW']

Functions selected by default when inserting/changing row, Functions are defined for meta types as (FUNC_NUMBER, FUNC_DATE, FUNC_CHAR, FUNC_SPATIAL, FUNC_UUID) and for first_timestamp, which is used for first timestamp column in table.

Example configuration

{
  "DefaultFunctions": {
    "FUNC_CHAR": "",
    "FUNC_DATE": "",
    "FUNC_NUMBER": "",
    "FUNC_SPATIAL": "ST_GeomFromText",
    "FUNC_UUID": "UUID",
    "first_timestamp": "UTC_TIMESTAMP"
  }
}

Default options for Transformations

$cfg['DefaultTransformations']
Type:

array

Default value:

An array with below listed key-values

$cfg['DefaultTransformations']['Substring']
Type:

array

Default value:

[0, 'all', '…']

$cfg['DefaultTransformations']['Bool2Text']
Type:

array

Default value:

['T', 'F']

$cfg['DefaultTransformations']['External']
Type:

array

Default value:

[0, '-f /dev/null -i -wrap -q', 1, 1]

$cfg['DefaultTransformations']['PreApPend']
Type:

array

Default value:

['', '']

$cfg['DefaultTransformations']['Hex']
Type:

array

Default value:

['2']

$cfg['DefaultTransformations']['DateFormat']
Type:

array

Default value:

[0, '', 'local']

$cfg['DefaultTransformations']['Inline']
Type:

array

Default value:

['100', 100]

Type:

array

Default value:

['', 100, 50]

Type:

array

Default value:

['', '', '']

Console settings

Note

These settings are mostly meant to be changed by user.

$cfg['Console']['StartHistory']
Type:

boolean

Default value:

false

Show query history at start

$cfg['Console']['AlwaysExpand']
Type:

boolean

Default value:

false

Always expand query messages

$cfg['Console']['CurrentQuery']
Type:

boolean

Default value:

true

Show current browsing query

$cfg['Console']['EnterExecutes']
Type:

boolean

Default value:

false

Execute queries on Enter and insert new line with Shift+Enter

$cfg['Console']['DarkTheme']
Type:

boolean

Default value:

false

Switch to dark theme

$cfg['Console']['Mode']
Type:

string

Default value:

'info'

Console mode

$cfg['Console']['Height']
Type:

integer

Default value:

92

Console height

Developer

Warning

These settings might have huge effect on performance or security.

$cfg['environment']
Type:

string

Default value:

'production'

Sets the working environment.

This only needs to be changed when you are developing BetterMyAdmin itself. The development mode may display debug information in some places.

Possible values are 'production' or 'development'.

$cfg['DBG']
Type:

array

Default value:

[]

$cfg['DBG']['sql']
Type:

boolean

Default value:

false

Enable logging queries and execution times to be displayed in the console’s Debug SQL tab.

$cfg['DBG']['sqllog']
Type:

boolean

Default value:

false

Enable logging of queries and execution times. phpMyAdmin sends them to syslog; BetterMyAdmin writes the same lines to the server’s error output (stderr) when each request ends. Requires $cfg['DBG']['sql'] to be enabled.

$cfg['DBG']['demo']
Type:

boolean

Default value:

false

Enable to let server present itself as demo server, like the phpMyAdmin demo server.

It currently changes following behavior:

  • There is welcome message on the main page.

  • There is footer information about demo server and used Git revision.

  • The setup script is enabled even with existing configuration.

  • The setup does not try to connect to the MySQL server.

$cfg['DBG']['simple2fa']
Type:

boolean

Default value:

false

Can be used for testing two-factor authentication using Simple two-factor authentication.

Examples

See following configuration snippets for typical setups of BetterMyAdmin. Each one is a complete bettermyadmin.config.json, or a part to merge into yours.

Basic example

Example configuration file, which can be copied to bettermyadmin.config.json to get some core configuration layout (it plays the role of phpMyAdmin’s config.sample.inc.php). Please note that it does not contain all configuration options, only the most frequently used ones.

{
  "blowfish_secret": "a string of 32 random characters",
  "Servers": [
    {
      "auth_type": "cookie",
      "host": "localhost",
      "compress": false,
      "AllowNoPassword": false,

      "controlhost": "",
      "controlport": "",
      "controluser": "pma",
      "controlpass": "pmapass",

      "pmadb": "phpmyadmin",
      "bookmarktable": "pma__bookmark",
      "relation": "pma__relation",
      "table_info": "pma__table_info",
      "table_coords": "pma__table_coords",
      "pdf_pages": "pma__pdf_pages",
      "column_info": "pma__column_info",
      "history": "pma__history",
      "table_uiprefs": "pma__table_uiprefs",
      "tracking": "pma__tracking",
      "userconfig": "pma__userconfig",
      "recent": "pma__recent",
      "favorite": "pma__favorite",
      "users": "pma__users",
      "usergroups": "pma__usergroups",
      "navigationhiding": "pma__navigationhiding",
      "savedsearches": "pma__savedsearches",
      "central_columns": "pma__central_columns",
      "designer_settings": "pma__designer_settings",
      "export_templates": "pma__export_templates"
    }
  ],
  "UploadDir": "",
  "SaveDir": ""
}

The same file as YAML (bettermyadmin.config.yaml) or as a TypeScript module (bettermyadmin.config.ts, see Installation) is equally valid.

Warning

Don’t use the controluser ‘pma’ if it does not yet exist and don’t use ‘pmapass’ as password.

Example for signon authentication

This example uses apps/server/examples/signon-page.mjs to demonstrate usage of Signon authentication mode, with the login page served by BetterMyAdmin itself ($cfg['Servers'][$i]['SignonPage']):

{
  "Servers": [{
    "auth_type": "signon",
    "SignonSession": "SignonSession",
    "SignonURL": "/signon/",
    "LogoutURL": "/signon/?logout",
    "SignonPage": "./apps/server/examples/signon-page.mjs"
  }]
}

With a separate login application, such as apps/server/examples/signon.ts (listening on port 8090), point $cfg['Servers'][$i]['SignonURL'] at it instead:

{
  "Servers": [{
    "auth_type": "signon",
    "SignonSession": "SignonSession",
    "SignonURL": "http://localhost:8090/"
  }]
}

Example for IP address limited autologin

If you want to automatically login when accessing BetterMyAdmin locally while asking for a password when accessing remotely, phpMyAdmin’s configuration tests $_SERVER['REMOTE_ADDR'] in PHP. A configuration file of BetterMyAdmin is read once at start, not on each request, so this cannot be done in the file. Run two instances instead: one listening on 127.0.0.1 only with config authentication, and a public one with cookie authentication:

{
  "Listen": { "host": "127.0.0.1", "port": 8081 },
  "Servers": [{ "auth_type": "config", "user": "root", "password": "yourpassword" }]
}

Note

Filtering based on IP addresses isn’t reliable over the internet, use it only for local address.

Example for using multiple MySQL servers

You can configure any number of servers using $cfg['Servers'], following example shows two of them:

{
  "blowfish_secret": "a string of 32 random characters",
  "Servers": [
    { "auth_type": "cookie", "verbose": "no1", "host": "localhost" },
    { "auth_type": "cookie", "verbose": "no2", "host": "remote.host.addr" }
  ],
  "ServerDefault": 0
}

The second server must allow remote clients (e.g. host 10.9.8.%), not only in mysql.user but also in its startup configuration. $cfg['ServerDefault'] 0 lets the user choose the server on startup.

Google Cloud SQL with SSL

To connect to Google Could SQL, you may 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 the name check fails. With verification you end up with an error message about the certificate name not matching the host.

Warning

With disabled verification your traffic is encrypted, but you’re open to man in the middle attacks.

To connect BetterMyAdmin to Google Cloud SQL using SSL download the client and server certificates and tell BetterMyAdmin to use them:

{
  "Servers": [{
    "host": "8.8.8.8",
    "ssl": true,
    "ssl_key": "../client-key.pem",
    "ssl_cert": "../client-cert.pem",
    "ssl_ca": "../server-ca.pem",
    "ssl_verify": false
  }]
}

host is the IP address of your instance; ssl_key the client secret key, ssl_cert the client certificate and ssl_ca the server certification authority. A relative path is resolved against BetterMyAdmin’s working directory.

Amazon RDS Aurora with SSL

To connect BetterMyAdmin to an Amazon RDS Aurora MySQL database instance using SSL, download the CA server certificate and tell BetterMyAdmin to use it:

{
  "Servers": [{
    "host": "replace-me-cluster-name.cluster-replace-me-id.replace-me-region.rds.amazonaws.com",
    "ssl": true,
    "ssl_ca": "../rds-combined-ca-bundle.pem",
    "ssl_verify": true
  }]
}

You need to have the region CA file and the authority CA file (2019 edition CA for example) in the PEM bundle for it to work.

reCaptcha using hCaptcha

CaptchaLoginPrivateKey is the secret key and CaptchaLoginPublicKey the site key from the hCaptcha dashboard:

{
  "CaptchaApi": "https://js.hcaptcha.com/1/api.js",
  "CaptchaCsp": "https://hcaptcha.com https://*.hcaptcha.com",
  "CaptchaRequestParam": "h-captcha",
  "CaptchaResponseParam": "h-captcha-response",
  "CaptchaSiteVerifyURL": "https://hcaptcha.com/siteverify",
  "CaptchaLoginPrivateKey": "0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "CaptchaLoginPublicKey": "xxx-xxx-xxx-xxx-xxxx"
}

See also

hCaptcha website

reCaptcha using Turnstile

{
  "CaptchaMethod": "checkbox",
  "CaptchaApi": "https://challenges.cloudflare.com/turnstile/v0/api.js",
  "CaptchaCsp": "https://challenges.cloudflare.com https://static.cloudflareinsights.com",
  "CaptchaRequestParam": "cf-turnstile",
  "CaptchaResponseParam": "cf-turnstile-response",
  "CaptchaLoginPublicKey": "0xxxxxxxxxxxxxxxxxxxxxx",
  "CaptchaLoginPrivateKey": "0x4AAAAAAAA_xx_xxxxxxxxxxxxxxxxxxxx",
  "CaptchaSiteVerifyURL": "https://challenges.cloudflare.com/turnstile/v0/siteverify"
}

reCaptcha using Google reCaptcha v2/v3

Remove CaptchaMethod if you do not want the checkbox mode:

{
  "CaptchaLoginPublicKey": "xxxxxxxxxxxxxxxx-xxxxxxxxxxxx",
  "CaptchaLoginPrivateKey": "xxxxxxxxx-xxxxxxxxxxxxxx",
  "CaptchaMethod": "checkbox"
}