设置

所有可配置的数据均位于phpMyAdmin的根目录中的 config.inc.php 中。若该文件不存在,请参考:ref:安装`一节来创建它。该文件中只需要包含与 :file:`libraries/config.default.php 中默认值不同的设置项(请不要修改这个文件)。

参见

Examples 为示例配置

如果文件中缺少指令,则只需在文件中添加另一行。该文件用于覆盖默认值;如果您想使用默认值,则无需在此处添加行。

与设计相关的设置(如颜色)是通过 themes/主题名/layout.inc.php 定义的。您也许想要创建 config.footer.inc.phpconfig.header.inc.php 文件向每个页面添加您网站的特殊代码作为页眉和页脚。

注解

有些版本(如:Debian 或 Ubuntu)将 config.inc.php 放在 /etc/phpmyadmin 中而不是 phpMyAdmin 源代码中。

警告

Mac 用户需要注意若您的系统版本低于 Mac OS X,PHP 似乎不支持 Mac 式的换行符(\r)。所以在保存您修改过的脚本之前请确保您设置了让文本编辑器使用 *nix 式的换行符(\n)保存文件。

基本设置

$cfg['PmaAbsoluteUri']
Type:文本
Default value:''

在 4.6.5 版更改: phpMyAdmin 4.6.0 - 4.6.4中没有此设置。

设置您 phpMyAdmin 安装文件夹的完整 URL`(包含路径)。如:``https://www.example.net/path_to_your_phpMyAdmin_directory/`。请注意大多数网站服务器的 URL 是区分大小写的(甚至在Windows上)。别忘了最后的斜杠。

自 2.3.0 起,我们建议尝试将该设置留空。大多数情况下 phpMyAdmin 能正确地自动识别。端口转发或复杂反向代理设置的用户可能需要设置此项。

通过浏览一张表、编辑并保存一条记录可以测试出自动识别是否有问题。若有问题 phpMyAdmin 会提示出错。若您收到了必须设置或自动识别失败的错误,请在我们的缺陷追踪器上向我们提交一份缺陷报告以便我们能改进相关代码。

$cfg['PmaNoRelation_DisableWarning']
Type:布尔值
Default value:false

自 2.3.0 起 phpMyAdmin 提供了一系列关于主/外表的功能 (参见 $cfg['Servers'][$i]['pmadb'])。

如果你尝试使用这些功能但无法正常使用,请在你想使用该功能的数据库中打开:guilabel:`结构`页。你会看到一个可以告诉你为什么这些功能无法使用的链接。

若您不想使用那些功能,将该项设为 true 即可隐藏提示信息。

$cfg['AuthLog']
Type:文本
Default value:'auto'

4.8.0 新版功能: 自phpMyAdmin 4.8.0起支持此功能。

配置认证记录目的地。失败(或全部,取决于:config:option:$cfg[‘AuthLogSuccess’])认证尝试将记录在这个目录下面:

auto
让phpMyAdmin自动选择``syslog``和``php``。
syslog
使用syslog及AUTH工具进行日志记录,在大多数系统上最后会输出到 /var/log/auth.log
php
记录到PHP错误日志。
sapi
记录到PHP SAPI日志记录。
/path/to/file
任何其他值都被视为文件名,并在那里写入日志条目。

注解

记录到文件时,请确保为Web服务器用户正确设置其权限,设置应严格匹配如下描述的说明:$cfg['TempDir']:

$cfg['AuthLogSuccess']
Type:布尔值
Default value:false

4.8.0 新版功能: 自phpMyAdmin 4.8.0起支持此功能。

是否将成功的身份验证尝试记录到:config:option:$cfg[‘AuthLog’]

$cfg['SuhosinDisableWarning']
Type:布尔值
Default value:false

若检测到 Suhosin 将在首页中显示警告。

将该项设为 true 即可隐藏提示信息。

$cfg['LoginCookieValidityDisableWarning']
Type:布尔值
Default value:false

如果PHP参数session.gc_maxlifetime低于phpMyAdmin中配置的cookie有效性,则主页上会显示警告。

将该项设为 true 即可隐藏提示信息。

$cfg['ServerLibraryDifference_DisableWarning']
Type:布尔值
Default value:false

4.7.0 版后已移除: 此设置已删除,因为警告也已删除。

若服务器与 MySQL 库版本不同将在首页中显示警告。

将该项设为 true 即可隐藏提示信息。

$cfg['ReservedWordDisableWarning']
Type:布尔值
Default value:false

若表的一个或多个字段名为 MySQL 保留字时将在该表的结构页中显示警告。

将该项设为 true 即可关闭该警告。

$cfg['TranslationWarningThreshold']
Type:整数
Default value:80

显示翻译不完整警告的阈值。

$cfg['SendErrorReports']
Type:文本
Default value:'ask'

设置JavaScript错误报告的默认行为。

每当在JavaScript执行中检测到错误时,如果用户同意,可以向phpMyAdmin团队发送错误报告。

每次出现新的错误报告时,默认设置``’ask’都会询问用户。但是你可以将这个参数设置为’always’来发送错误报告而不要求确认,或者你可以将它设置为’never’``永不发送错误报告。

该指令在配置文件和用户首选项中均可用。如果负责多用户安装的人员更喜欢为所有用户禁用此功能,则应设置值为``’never’,并且 :config:option:`$cfg['UserprefsDisallow']`指令应该在其中一个数组值中包含’SendErrorReports’``

$cfg['ConsoleEnterExecutes']
Type:布尔值
Default value:false

将其设置为``true``允许用户通过按Enter而不是Ctrl + Enter来执行查询。按Shift + Enter可以插入新行。

可以使用控制台的设置界面临时更改控制台的行为。

$cfg['AllowThirdPartyFraming']
Type:布尔值|文本
Default value:false

将该项设为 true 将允许 phpMyAdmin 被嵌入到框架中,同时是一个潜在的安全隐患并将导致跨框架脚本攻击或点击劫持成为可能。将此设置为’sameorigin’可防止phpMyAdmin包含在框架中的其他文档中,除非该文档属于同一域名。

服务器连接设置

$cfg['Servers']
Type:数组
Default value:一个服务器数组,下面列出了设置

自 1.4.2 起,phpMyAdmin 支持管理多个 MySQL 服务器。因此使用了 $cfg['Servers'] 数组来保存不同服务器的登录信息。第一个 $cfg['Servers'][$i]['host'] 表示第一个服务器的主机名,第二个 $cfg['Servers'][$i]['host'] 表示第二个服务器的主机名,以此类推。在 libraries/config.default.php 中,只有一节服务器的设置,您可以根据需要将其多次复制到 config.inc.php 中,完全复制或仅复制需要的部分(您要修改的部分)都行。

注解

$cfg['Servers'] 数组由 $cfg[‘Servers’][1] 开始。请勿使用 $cfg[‘Servers’][0]。若您需要多个服务器,请复制(包含自增的 $i)多次。您不需要设置所有服务器数组,设置您要修改的值即可。

$cfg['Servers'][$i]['host']
Type:文本
Default value:'localhost'

您第 $i 个 MySQL 服务器的主机名或 IP 地址。如 localhost

有效值有:

  • 主机名,如:'localhost''mydb.example.org'
  • IP 地址,如:'127.0.0.1''192.168.10.1'
  • IPv6 地址, 如``2001:cdba:0000:0000:0000:0000:3257:9652``
  • 点 - '.',即 Windows 系统上的命名管道
  • 空 - '',禁用该服务器

注解

主机名``localhost``由MySQL专门处理,它使用基于套接字的连接协议。要使用TCP/IP网络,请使用IP地址或主机名,例如``127.0.0.1``或``db.example.com``。您可以使用:config:option:`$cfg[‘Servers’][$i][‘socket’]`配置套接字的路径。

$cfg['Servers'][$i]['port']
Type:文本
Default value:''

您第 $i 个 MySQL 服务器的端口号。默认(留空)为 3306。

注解

若您使用 localhost 作为主机名,MySQL 将忽略端口号而使用套接字进行连接,所以若您想连接到非默认端口,请在 $cfg['Servers'][$i]['host'] 中填写 127.0.0.1 或真正的主机名。

$cfg['Servers'][$i]['socket']
Type:文本
Default value:''

要使用的套接字路径。留空为默认。要确定正确的套接字,请查看您的 MySQL 设置,或使用 MySQL 命令行客户端执行 status 命令。该命令将会显示出所使用的套接字。

注解

它仅当 $cfg['Servers'][$i]['host'] 设置为 ``localhost``的时候会生效。

$cfg['Servers'][$i]['ssl']
Type:布尔值
Default value:false

是否为phpMyAdmin和MySQL服务器之间的连接启用SSL以保护连接。

当使用``’mysql’扩展名时,其余的’ssl…’``配置选项都不适用。

我们强烈建议您在使用该项的同时使用``’mysqli’``扩展。

$cfg['Servers'][$i]['ssl_key']
Type:文本
Default value:

通过 SSL 连接到 MySQL 服务器时所用的客户端密钥文件路径。这用于向服务器验证客户端。

如:

$cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/server-key.pem';
$cfg['Servers'][$i]['ssl_cert']
Type:文本
Default value:

通过 SSL 连接到 MySQL 服务器时所用的客户端证书文件路径。这用于向服务器验证客户端。

$cfg['Servers'][$i]['ssl_ca']
Type:文本
Default value:

通过 SSL 连接到 MySQL 服务器时所用的证书颁发机构文件路径。

$cfg['Servers'][$i]['ssl_ca_path']
Type:文本
Default value:

存放有 PEM 格式的受信任 SSL 证书颁发机构证书的文件夹。

$cfg['Servers'][$i]['ssl_ciphers']
Type:文本
Default value:

通过 SSL 连接到 MySQL 服务器时可以使用的加密算法列表。

$cfg['Servers'][$i]['ssl_verify']
Type:布尔值
Default value:true

4.6.0 新版功能: 自phpMyAdmin 4.6.0起支持此功能。

如果您的PHP安装使用MySQL本机驱动程序(mysqlnd),您的MySQL服务器是5.6或更高版本,并且您的SSL证书是自签名的,那么您的SSL连接可能会因验证而失败。将其设置为``false``将禁用验证检查。

从PHP 5.6.0开始,它还验证服务器名称是否与其证书的CN匹配。目前无法在不禁用完整SSL验证的情况下禁用此检查。

警告

禁用证书验证会失去使用SSL的意义。这将使连接易受中间人攻击。

注解

此标志仅适用于PHP 5.6.16或更高版本。

$cfg['Servers'][$i]['connect_type']
Type:文本
Default value:'tcp'

4.7.0 版后已移除: 从4.7.0开始不再使用此设置,因为MySQL根据主机决定连接类型,因此可能会导致意外结果。请相应地设置:config:option:`$cfg[‘Servers’][$i][‘host’]`选项。

设置如何连接到 MySQL 服务器。您可以选择 'socket''tcp'。默认为 tcp,因为几乎所有的 MySQL 服务器都支持,而有些平台是不支持套接字的。要使用套接字方式连接,您的 MySQL 服务器必须和网站服务器在同一台服务器上。

$cfg['Servers'][$i]['compress']
Type:布尔值
Default value:false

设置是否使用压缩协议连接到 MySQL 服务器(试验性的)。

$cfg['Servers'][$i]['controlhost']
Type:文本
Default value:''

设置使用一个其它的主机来保存高级功能的数据。

$cfg['Servers'][$i]['controlport']
Type:文本
Default value:''

设置通过一个其它的端口来连接到保存高级功能数据的主机。

$cfg['Servers'][$i]['controluser']
Type:文本
Default value:''
$cfg['Servers'][$i]['controlpass']
Type:文本
Default value:''

这个特殊帐户用于访问:ref:linked-tables。在单用户案例中不需要它,但如果共享phpMyAdmin,建议只向该用户授予对:ref:linked-tables 的访问权限,并配置phpMyAdmin使用它。然后,所有用户都可以使用这些功能,而无需直接访问:ref:linked-tables

在 2.2.5 版更改: 它们叫做``stduser``和``stdpass``

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

4.7.0 新版功能.

您可以使用前缀为``control_``的配置更改控件链接的任何MySQL连接设置(用于访问:ref:linked-tables)。

这可以用于更改控件连接的任何方面,默认情况下使用与用户相同的参数。

例如,您可以为控件连接配置SSL:

// Enable SSL
$cfg['Servers'][$i]['control_ssl'] = true;
// Client secret key
$cfg['Servers'][$i]['control_ssl_key'] = '../client-key.pem';
// Client certificate
$cfg['Servers'][$i]['control_ssl_cert'] = '../client-cert.pem';
// Server certification authority
$cfg['Servers'][$i]['control_ssl_ca'] = '../server-ca.pem';
$cfg['Servers'][$i]['auth_type']
Type:文本
Default value:'cookie'

设置该服务器是使用 config 还是 cookie 还是 HTTP 还是 signon 认证方式。

  • ‘config’ 认证方式($auth_type  =  'config')是最原始的方法:将用户名和密码保存在 config.inc.php 中。
  • ‘cookie’认证方式($auth_type = 'cookie')将借助cookie允许您使用任何有效的 MySQL 用户登录。
  • ‘http’ 基本认证方式将允许您通过http认证使用任何有效的 MySQL 用户登录。
  • ‘signon’ 认证方式($auth_type = 'signon')将允许您从准备好的PHP会话数据或使用提供的PHP脚本登录。
$cfg['Servers'][$i]['auth_http_realm']
Type:文本
Default value:''

在 auth_type = http 时,您可以通过该项设置一个自定义的 HTTP 基本认证提示信息给用户。若不设置,将使用“phpMyAdmin ”加上 $cfg['Servers'][$i]['verbose']$cfg['Servers'][$i]['host']

$cfg['Servers'][$i]['user']
Type:文本
Default value:'root'
$cfg['Servers'][$i]['password']
Type:文本
Default value:''

使用:config:option:`$cfg[‘Servers’][$i][‘auth_type’]`时设置为’config’,这是phpMyAdmin用来连接MySQL服务器的用户/密码对。在:term:`HTTP`或cookie身份验证的时候不需要此用户/密码对,并且应为空。

$cfg['Servers'][$i]['nopassword']
Type:布尔值
Default value:false

4.7.0 版后已移除: 此设置已删除,因为它可能会产生意外结果。

设置使用密码登录失败时是否允许尝试使用空密码登录。可与 http 认证同时使用,或通过其他方式完成认证使得 phpMyAdmin 取得用户名及空密码来连接到 MySQL 。然而总是会先尝试使用密码登录的。

$cfg['Servers'][$i]['only_db']
Type:字符串或数组
Default value:''

设置一个 (或一组) 数据库名,用户只能看到这些数据库。自 phpMyAdmin 2.2.1 起,数据库名可以包含 MySQL 通配符 (“_” 和 “%”): 如果你想使用这些字符本身,请转义它们 (即: 要使用 'my\_db' 而不是 'my_db')。

此设置可有效降低服务器的负载,因为不需要向 MySQL 发送构建可用数据库列表的请求。但**它并不能取代 MySQL 数据库服务器的权限规则**。这仅意味着这些数据库被显示出来而已,而**不是说没有显示出来的数据库都不能用。**

使用多个数据库的示例:

$cfg['Servers'][$i]['only_db'] = array('db1', 'db2');

在 4.0.0 版更改: 以前的版本允许通过此指令指定数据库名称的显示顺序。

$cfg['Servers'][$i]['hide_db']
Type:文本
Default value:''

对非特权用户隐藏数据库的正则表达式。 这仅仅将数据库从列表中隐藏,用户仍然可以直接访问 (如通过 SQL 查询)。要彻底限制访问,请使用 MySQL 权限系统。例如,要隐藏所有开头字母是a的数据库,使用

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

同时隐藏db1和db2,使用

$cfg['Servers'][$i]['hide_db'] = '^(db1|db2)$';

可以在 PHP 手册的 `PCRE正则语法<https://secure.php.net/manual/zh/reference.pcre.pattern.syntax.php>`_ 一节中找到更多关于正则表达式的信息。

$cfg['Servers'][$i]['verbose']
Type:文本
Default value:''

仅在通过 phpMyAdmin 管理多个服务器时有用。主页的下拉菜单中将用此值代替主机名。如果你想只显示系统中部分数据库时也有用,如,使用 HTTP 认证时,所有非 ASCII 字符都将被删除。

$cfg['Servers'][$i]['extension']
Type:文本
Default value:'mysqli'

4.2.0 版后已移除: 此设置已删除。仅当``mysqli``扩展名不可用时才会使用``mysql``扩展名。从5.0.0开始,只能使用``mysqli``扩展名。

要使用的PHP MySQL扩展(mysql``或``mysqli)。

建议在所有安装中使用``mysqli``。

$cfg['Servers'][$i]['pmadb']
Type:文本
Default value:''

包含 phpMyAdmin 高级功能数据的数据库名。

参见:ref:`linked-tables`一节了解其好处以及如何快速创建该数据库和需要的数据表。

如果此 phpMyAdmin 只有你自己使用,你可以用你当前的数据库来保存这些特殊的数据表,这种情况下,你可以在 $cfg['Servers'][$i]['pmadb'] 中填写当前数据库的名字。若此 phpMyAdmin 作为多用户使用,请设为包含 phpMyAdmin 高级功能数据表的专用数据库。

$cfg['Servers'][$i]['bookmarktable']
Type:字符串或“false”
Default value:''

自 2.2.0 起 phpMyAdmin 允许用户将查询加入书签。你可以将经常要执行的语句加入书签。要允许使用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['relation']
Type:字符串或“false”
Default value:''

自 2.2.4 起你可以在 ‘relation’ 表的支持下定义一张表中的一个字段与另一张表的关系 (外键)。目前 phpMyAdmin 将它用于:

  • 使外键数据可点击,浏览主表时可通过点击数据值转到外表;
  • 在浏览主表时,当鼠标移到含有外键的字段上用气泡提示显示可选的“显示的字段” (需同时使用 ‘table_info’ 表) ;(参见:ref:faqdisplay
  • 在编辑/插入时,显示可能的外键下拉列表 (显示为键值和&quot;显示的字段&quot;) (参见:ref:faq6_21
  • 在表的属性页上为每个键显示检查参照完整性的链接(用于显示缺失的外键);
  • 通过依例查询自动创建关联查询 (参见 6.6 How can I use the relation table in Query-by-example?)
  • 生成 PDF 格式的数据库大纲 (需同时使用 table_coords 表)。

字段值可以是数字或者字符。

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

注解

请注意在当前版本中 master_db 必须和 foreign_db 一致。这两个字段是为后期跨数据库关系开发预留的。

$cfg['Servers'][$i]['table_info']
Type:字符串或“false”
Default value:''

自 2.3.0 起你可以在一个特殊的 ‘table_info’ 表的支持下设置当鼠标移到对应字段时用气泡提示显示出来的相应内容。此配置变量将保留此特殊表的名称。要允许使用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['table_coords']
Type:字符串或“false”
Default value:''

设计器功能可以保存您的页面布局;通过在展开的设计器菜单中按“保存页面”或“将页面另存为”按钮,您可以自定义布局并在下次使用设计器时加载它。该布局存储在此表中。此外,使用PDF关系导出功能也需要此表,请参阅:config:option:`$cfg[‘Servers’][$i][‘pdf_pages’]`以获取更多详细信息。

$cfg['Servers'][$i]['pdf_pages']
Type:字符串或“false”
Default value:''

自 2.3.0 版本起你可以用 phpMyAdmin 创建 PDF 页面来显示各数据表之间的关系。要实现这个功能需要两张数据表, “pdf_pages” (保存可用 PDF 页的信息) 和 “table_coords” (保存每张表在 PDF 大纲输出中的坐标)。您必须使用“关系”功能。

要启用此功能:

可以通过将任一配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['column_info']
Type:字符串或“false”
Default value:''

这部分需要更新内容! 自 2.3.0 起您可以存储注释来描述每个表的每个列。然后这些将显示在“打印视图”上。

从版本2.5.0开始,注释因此在表属性页面和表浏览视图中使用,在列名称(属性页面)上方显示为工具提示或嵌入在浏览视图中的表头中。它们也可以显示在表转储中。请稍后查看相关的配置指令。

自 2.5.0 起 MIME 类型转换系统同样基于下列数据表结构。详情请参见:ref:transformations。要想使用 MIME 类型转换系统,column_info 表必须有这三个新字段 ‘mimetype’、’transformation’ 和 ‘transformation_options’ 。

从4.3.0版开始,引入了一种新的面向输入的转换系统。此外,删除了旧转换系统中使用的向后兼容性代码。因此,对于先前的转换和新的面向输入的转换系统来说,必须更新column_info表。 phpMyAdmin将通过分析您当前的column_info表结构自动为您升级它。但是,如果自动升级出现问题,那么您可以使用``./sql/upgrade_column_info_4_3_0+.sql``中的SQL脚本手动升级它。

要启用此功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储

  • $cfg['Servers'][$i]['column_info'] 中设置要使用的数据表名 (如:pma__column_info)

  • 要更新你的PRE-2.5.0 Column_comments表,使用这个: 并记住:file:config.inc.php`中的变量已从:samp:`$cfg[‘Servers’][$i][‘column_comments’]`被重命名到:config:option:`$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;
    
  • 要手动更新PRE-4.3.0 Column_info表,使用这个``./sql/upgrade_column_info_4_3_0+.sql``SQL脚本。

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['history']
Type:字符串或“false”
Default value:''

自 2.5.0 起你可以保存在 phpMyAdmin 中输入的 SQL 查询历史,即存储您手动输入到phpMyAdmin界面的所有查询。如果你不想使用基于数据表的历史记录,也可以使用基于 JavaScript 的历史记录。

使用它,关闭窗口时将删除所有历史记录项。通过 $cfg['QueryHistoryMax'] 可以定义保存历史记录的最大数量。过量历史记录的删除操作将在每次登录时执行。

查询历史仅在浏览器启用 JavaScript 时可用。

要启用此功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储
  • 把表名放在:config:option:$cfg[‘Servers’][$i][‘history’]`(例如``pma__history`

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['recent']
Type:字符串或“false”
Default value:''

从版本3.5.0开始,您可以在导航面板中显示最近使用的表格。它可以帮助您直接跳过表,而无需选择数据库,然后选择表。使用:config:option:`$cfg[‘NumRecentTables’]`您可以配置显示的最近表的最大数量。当您从列表中选择一个表时,它将跳转到:config:option:`$cfg[‘NavigationTreeDefaultTabTable’]`当中指定的页面。

如果不配置存储,您仍然可以访问最近使用的表,但在注销后它将消失。

要永久允许使用此功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储
  • 把表名放在:config:option:$cfg[‘Servers’][$i][‘recent’]`(如:``pma__recent`

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['favorite']
Type:字符串或“false”
Default value:''

从版本4.2.0开始,您可以在导航面板中显示所选表的列表。它可以帮助您直接跳转到表,而无需选择数据库,然后选择表。当您从列表中选择一个表时,它将跳转到:config:option:`$cfg[‘NavigationTreeDefaultTabTable’]`当中指定的页面。

您可以通过单击表名旁边的星形图标将表添加到此列表或从数据库结构页中删除表。使用:config:option:$cfg[‘NumFavoriteTables’] 你可以配置显示的最喜欢的表数。

如果不配置存储,您仍然可以访问收藏表,但在注销后它将消失。

要永久允许使用此功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储
  • 把表名放在:config:option:$cfg[‘Servers’][$i][‘favorite’]`(例如``pma__favorite`

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['table_uiprefs']
Type:字符串或“false”
Default value:''

从版本3.5.0开始,phpMyAdmin可以配置为记住几个事项(排序列:config:option:$cfg[‘RememberSorting’],列顺序和数据库表中的列可见性)用于浏览表。如果不配置存储,仍可以使用这些功能,但注销后值将消失。

允许持久使用这些功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储
  • 把表名放在:config:option:$cfg[‘Servers’][$i][‘table_uiprefs’]`(例如``pma__table_uiprefs`

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['users']
Type:字符串或“false”
Default value:''
$cfg['Servers'][$i]['usergroups']
Type:字符串或“false”
Default value:''

从4.1.0版开始,您可以创建不同的用户组,并附加菜单项。可以将用户分配给这些组,并且登录用户只能看到配置给他分配给的用户组的菜单项。为此,它需要两个表“usergroups”(为每个用户组存储允许的菜单项)和“users”(将用户及其分配存储到用户组)。

要启用此功能:

  • 设置好 $cfg['Servers'][$i]['pmadb'] 和 phpMyAdmin 配置存储
  • 将正确的表名放在:config:option:$cfg[‘Servers’][$i][‘users’]`(如``pma__users`)和:config:option:$cfg[‘Servers’][$i][‘usergroups’]`(如``pma__usergroups`

可以通过将任一配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['navigationhiding']
Type:字符串或“false”
Default value:''

从4.1.0版开始,您可以隐藏/显示导航树中的项目。

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['central_columns']
Type:字符串或“false”
Default value:''

4.3.0版开始,您可以拥有每个数据库的列的中央列表。您可以根据需要在列表中添加/删除列。在为表创建新列或创建表本身时,可以使用中央列表中的这些列。您可以在创建新列时从中央列表中选择一列,这样可以避免再次编写相同的列定义或者为类似列编写不同的名称。

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['designer_settings']
Type:字符串或“false”
Default value:''

Since release 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.

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['savedsearches']
Type:字符串或“false”
Default value:''

Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel.

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['export_templates']
Type:字符串或“false”
Default value:''

Since release 4.5.0 you can save and load export templates.

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['tracking']
Type:字符串或“false”
Default value:''

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

创建版本会造成两个影响:

  • phpMyAdmin 保存当前数据表的快照,包括结构和索引。
  • phpMyAdmin 针对当前数据表记录的所有修改结构和/或数据的命令都将与版本关联。

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.

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['tracking_version_auto_create']
Type:布尔值
Default value:false

设置追踪系统是否自动为数据表和视图创建版本。

若设为 true 然后你通过

  • CREATE TABLE …
  • CREATE VIEW …

创建了一张表或视图并且它当前没有任何版本,系统将会自动为你创建一个版本。

$cfg['Servers'][$i]['tracking_default_statements']
Type:文本
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'

定义自动创建新版的命令列表。

$cfg['Servers'][$i]['tracking_add_drop_view']
Type:布尔值
Default value:true

设置当记录视图创建时,是否在前面加上 DROP VIEW IF EXISTS 命令。

$cfg['Servers'][$i]['tracking_add_drop_table']
Type:布尔值
Default value:true

设置当记录数据表创建时,是否在前面加上 DROP TABLE IF EXISTS 命令。

$cfg['Servers'][$i]['tracking_add_drop_database']
Type:布尔值
Default value:true

设置当记录数据库创建时,是否在前面加上 DROP DATABASE IF EXISTS 命令。

$cfg['Servers'][$i]['userconfig']
Type:字符串或“false”
Default value:''

自 3.4.x 起 phpMyAdmin 允许用户自己设置大部分偏好并将设置保存在数据库中。

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

要启用此功能:

可以通过将配置设置为``false``来禁用此功能。

$cfg['Servers'][$i]['MaxTableUiprefs']
Type:整数
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:文本
Default value:''

Sets the time zone used by phpMyAdmin. Leave blank to use the time zone of your database server. Possible values are explained at https://dev.mysql.com/doc/refman/5.7/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 phpMyAdmin.

$cfg['Servers'][$i]['AllowRoot']
Type:布尔值
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:布尔值
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:文本
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:array()

规则的格式通常为:

<'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 (please note that those containing SERVER_ADDRESS might not be available on all webservers):

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

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

For the IP 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)

而下列形式是无效的:

  • 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)

而下列形式是无效的:

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

Examples:

$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow bob from all');
// Allow only 'bob' to connect from any host

$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow mary from 192.168.100.[50-100]');
// Allow only 'mary' to connect from host 192.168.100.50 through 192.168.100.100

$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow % from 192.168.[5-6].10');
// Allow any user to connect from host 192.168.5.10 or 192.168.6.10

$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow root from 192.168.5.50','allow % from 192.168.6.10');
// Allow any user to connect from 192.168.6.10, and additionally allow root to connect from 192.168.5.50
$cfg['Servers'][$i]['DisableIS']
Type:布尔值
Default value:false

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

注解

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

$cfg['Servers'][$i]['SignonScript']
Type:文本
Default value:''

3.5.0 新版功能.

Name of PHP script to be sourced and executed to obtain login credentials. This is alternative approach to session based single signon. The script has to provide a function called get_login_credentials which returns list of username and password, accepting single parameter of existing username (can be empty). See examples/signon-script.php for an example:

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Single signon for phpMyAdmin
 *
 * This is just example how to use script based single signon with
 * phpMyAdmin, it is not intended to be perfect code and look, only
 * shows how you can integrate this functionality in your application.
 *
 * @package    PhpMyAdmin
 * @subpackage Example
 */
declare(strict_types=1);

/**
 * This function returns username and password.
 *
 * It can optionally use configured username as parameter.
 *
 * @param string $user User name
 *
 * @return array
 */
function get_login_credentials($user)
{
    /* Optionally we can use passed username */
    if (!empty($user)) {
        return [$user, 'password'];
    }

    /* Here we would retrieve the credentials */
    $credentials = ['root', ''];

    return $credentials;
}
$cfg['Servers'][$i]['SignonSession']
Type:文本
Default value:''

Name of session which will be used for signon authentication method. You should use something different than phpMyAdmin, because this is session which phpMyAdmin uses internally. Takes effect only if $cfg['Servers'][$i]['SignonScript'] is not configured.

$cfg['Servers'][$i]['SignonCookieParams']
Type:数组
Default value:array()

4.7.0 新版功能.

An associative array of session cookie parameters of other authentication system. It is not needed if the other system doesn’t use session_set_cookie_params(). Keys should include ‘lifetime’, ‘path’, ‘domain’, ‘secure’ or ‘httponly’. Valid values are mentioned in session_get_cookie_params, 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:文本
Default value:''

URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol.

$cfg['Servers'][$i]['LogoutURL']
Type:文本
Default value:''

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

Generic settings

$cfg['DisableShortcutKeys']
Type:布尔值
Default value:false

You can disable phpMyAdmin shortcut keys by setting $cfg['DisableShortcutKeys'] to false.

$cfg['ServerDefault']
Type:整数
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 phpMyAdmin 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:布尔值
Default value:true

Enables check for latest versions using JavaScript on the main phpMyAdmin page or by directly accessing version_check.php.

注解

This setting can be adjusted by your vendor.

$cfg['ProxyUrl']
Type:文本
Default value:”“

The url of the proxy to be used when phpmyadmin 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 phpMyAdmin is installed does not have direct access to the internet. The format is: “hostname:portnumber”

$cfg['ProxyUser']
Type:文本
Default value:”“

连接代理服务器时使用的用户名。如果提供用户名,将使用基本认证方式连接。目前还不支持其他认证方式。

$cfg['ProxyPass']
Type:文本
Default value:”“

代理服务的密码.

$cfg['MaxDbList']
Type:整数
Default value:100

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

$cfg['MaxTableList']
Type:整数
Default value:250

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

$cfg['ShowHint']
Type:布尔值
Default value:true

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

$cfg['MaxCharactersInDisplayedSQL']
Type:整数
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:布尔值
Default value:false

Whether persistent connections should be used or not. Works with following extensions:

$cfg['ForceSSL']
Type:布尔值
Default value:false

4.6.0 版后已移除: This setting is no longer available since phpMyAdmin 4.6.0. Please adjust your webserver instead.

Whether to force using https while accessing phpMyAdmin. In a reverse proxy setup, setting this to true is not supported.

注解

In some setups (like separate SSL proxy or load balancer) you might have to set $cfg['PmaAbsoluteUri'] for correct redirection.

$cfg['ExecTimeLimit']
Type:integer [number of seconds]
Default value:300

Set the number of seconds a script is allowed to run. If seconds is set to zero, no time limit is imposed. This setting is used while importing/exporting dump files but has no effect when PHP is running in safe mode.

$cfg['SessionSavePath']
Type:文本
Default value:''

Path for storing session data (session_save_path PHP parameter).

警告

This folder should not be publicly accessible through the webserver, otherwise you risk leaking private data from your session.

$cfg['MemoryLimit']
Type:string [number of bytes]
Default value:'-1'

Set the number of bytes a script is allowed to allocate. If set to '-1', no limit is imposed. If set to '0', no change of the memory limit is attempted and the php.ini memory_limit is used.

This setting is used while importing/exporting dump files so you definitely don’t want to put here a too low value. It has no effect when PHP is running in safe mode.

You can also use any string as in php.ini, eg. ‘16M’. Ensure you don’t omit the suffix (16 means 16 bytes!)

$cfg['SkipLockedTables']
Type:布尔值
Default value:false

标记正在使用的表以使得可以显示含有已锁定表的数据库 (自 MySQL 3.23.30 起) 。

$cfg['ShowSQL']
Type:布尔值
Default value:true

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

$cfg['RetainQueryBox']
Type:布尔值
Default value:false

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

$cfg['CodemirrorEnable']
Type:布尔值
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['DefaultForeignKeyChecks']
Type:文本
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:布尔值
Default value:false

警告

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:布尔值
Default value:true

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

$cfg['UseDbSearch']
Type:布尔值
Default value:true

设置是否允许使用 “数据库搜索” 。

$cfg['IgnoreMultiSubmitErrors']
Type:布尔值
Default value:false

设置 phpMyAdmin 是否在执行多语句查询出错的时候继续执行。默认为中断执行。

$cfg['enable_drag_drop_import']
Type:布尔值
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 phpMyAdmin will attempt to import the file.

主面板

$cfg['ShowStats']
Type:布尔值
Default value:true

Defines whether or not to display space usage and statistics about databases and tables. Note that statistics requires at least MySQL 3.23.3 and that, at this date, MySQL doesn’t return such information for Berkeley DB tables.

$cfg['ShowServerInfo']
Type:布尔值
Default value:true

Defines whether to display detailed server information on main page. You can additionally hide more information by using $cfg['Servers'][$i]['verbose'].

$cfg['ShowPhpInfo']
Type:布尔值
Default value:false

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

Please note that to block the usage of phpinfo() in scripts, you have to put this in your php.ini:

disable_functions = phpinfo()

警告

Enabling phpinfo page will leak quite a lot of information about 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:布尔值
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:布尔值
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:布尔值
Default value:true

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

$cfg['MysqlMinVersion']
Type:数组

Defines the minimum supported MySQL version. The default is chosen by the phpMyAdmin team; however this directive was asked by a developer of the Plesk control panel to ease integration with older MySQL servers (where most of the phpMyAdmin features work).

数据库结构

$cfg['ShowDbStructureCreation']
Type:布尔值
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:布尔值
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:布尔值
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:布尔值
Default value:true

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

$cfg['ShowColumnComments']
Type:布尔值
Default value:true

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

浏览模式

$cfg['TableNavigationLinksMode']
Type:文本
Default value:'icons'

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

$cfg['ActionLinksMode']
Type:文本
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:文本
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:布尔值
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:整数
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:文本
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.

在 3.4.0 版更改: Since phpMyAdmin 3.4.0 the default value is 'SMART'.

$cfg['GridEditing']
Type:文本
Default value:'double-click'

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

$cfg['RelationalDisplay']
Type:文本
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:布尔值
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:布尔值
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:布尔值
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:整数
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:整数
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:数组
Default value:array(‘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:布尔值
Default value:true
$cfg['GZipDump']
Type:布尔值
Default value:true
$cfg['BZipDump']
Type:布尔值
Default value:true

设置在创建转储文件时是否允许使用 zip/GZip/BZip2 压缩

$cfg['CompressOnFly']
Type:布尔值
Default value:true

Defines whether to allow on the fly compression for GZip/BZip2 compressed exports. This doesn’t affect smaller dumps and allows users to create larger dumps that won’t otherwise fit in memory due to php memory limit. Produced files contain more GZip/BZip2 headers, but all normal programs handle this correctly.

$cfg['Export']
Type:数组
Default value:array(…)

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:文本
Default value:'sql'

Default export format.

$cfg['Export']['method']
Type:文本
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']['charset']
Type:文本
Default value:''

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

$cfg['Export']['file_template_table']
Type:文本
Default value:'@TABLE@'

Default filename template for table exports.

$cfg['Export']['file_template_database']
Type:文本
Default value:'@DATABASE@'

Default filename template for database exports.

$cfg['Export']['file_template_server']
Type:文本
Default value:'@SERVER@'

Default filename template for server exports.

$cfg['Import']
Type:数组
Default value:array(…)

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:文本
Default value:''

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

Tabs display settings

$cfg['TabsMode']
Type:文本
Default value:'both'

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

$cfg['PropertiesNumColumns']
Type:整数
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:文本
Default value:'welcome'

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

  • welcome (recommended for multi-user setups)
  • databases,
  • status
  • variables
  • privileges
$cfg['DefaultTabDatabase']
Type:文本
Default value:'structure'

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

  • structure
  • sql
  • search
  • operations
$cfg['DefaultTabTable']
Type:文本
Default value:'browse'

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

  • structure
  • sql
  • search
  • insert
  • browse

PDF Options

$cfg['PDFPageSizes']
Type:数组
Default value:array('A3', 'A4', 'A5', 'letter', 'legal')

Array of possible paper sizes for creating PDF pages.

You should never need to change this.

$cfg['PDFDefaultPageSize']
Type:文本
Default value:'A4'

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

Languages

$cfg['DefaultLang']
Type:文本
Default value:'en'

Defines the default language to use, if not browser-defined or user- defined. The corresponding language file needs to be in locale/code/LC_MESSAGES/phpmyadmin.mo.

$cfg['DefaultConnectionCollation']
Type:文本
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:文本
Default value:not set

Force language to use. The corresponding language file needs to be in locale/code/LC_MESSAGES/phpmyadmin.mo.

$cfg['FilterLanguages']
Type:文本
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:文本
Default value:'auto'

你可以在这里选择使用哪个函数来转换字符集。可选值有:

  • 自动 (auto) - 自动选择可用的函数 (首先尝试 iconv,然后 recode)
  • iconv - 使用 iconv 或 libiconv 函数
  • recode - use recode_string function
  • mb - use mbstring extension
  • 无 (none) - 禁止编码转换

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

$cfg['IconvExtraParams']
Type:文本
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:数组
Default value:array(…)

Available character sets for MySQL conversion. You can add your own (any of supported by recode/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.

Web server settings

$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), phpMyAdmin 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.

$cfg['TrustedProxies']
Type:数组
Default value:array()

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 phpMyAdmin should trust a HTTP_X_FORWARDED_FOR (X -Forwarded-For) header coming from the proxy 1.2.3.4:

$cfg['TrustedProxies'] = array('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:文本
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 函数库可以使用
  • 否 (no) - GD 2 函数库不可用
$cfg['CheckConfigurationPermissions']
Type:布尔值
Default value:true

We normally check the permissions on the configuration file to ensure it’s not world writable. However, phpMyAdmin could be installed 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:整数
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 .

$cfg['CSPAllow']
Type:文本
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 include some external JavaScript files in config.footer.inc.php or config.header.inc.php, which would be normally not allowed by Content Security Policy.

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

$cfg['CSPAllow'] = 'example.com example.net';

4.0.4 新版功能.

$cfg['DisableMultiTableMaintenance']
Type:布尔值
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

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

Design customization

$cfg['NavigationTreePointerEnable']
Type:布尔值
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:布尔值
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:布尔值
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:整数
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:文本
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:布尔值
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:布尔值
Default value:true

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

$cfg['TablePrimaryKeyOrder']
Type:文本
Default value:'NONE'

This defines the default sort order for the tables, having a primary key, when there is no sort order defines externally. Acceptable values : [‘NONE’, ‘ASC’, ‘DESC’]

$cfg['ShowBrowseComments']
Type:布尔值
Default value:true
$cfg['ShowPropertyComments']
Type:布尔值
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['CharEditing']
Type:文本
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) - 允许限制输入字数使其不超过 MySQL 字段限制,但无法换行
  • 文本框 (textarea) - 可以换行,但没有字数限制
$cfg['MinSizeForInputField']
Type:整数
Default value:4

定义了当编辑 CHAR 和 VARCHAR 字段时所使用输入框的最小大小。

$cfg['MaxSizeForInputField']
Type:整数
Default value:60

定义了当编辑 CHAR 和 VARCHAR 字段时所使用输入框的最大大小。

$cfg['TextareaCols']
Type:整数
Default value:40
$cfg['TextareaRows']
Type:整数
Default value:15
$cfg['CharTextareaCols']
Type:整数
Default value:40
$cfg['CharTextareaRows']
Type:整数
Default value:2

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']).

$cfg['LongtextDoubleTextarea']
Type:布尔值
Default value:true

Defines whether textarea for LONGTEXT columns should have double size.

$cfg['TextareaAutoSelect']
Type:布尔值
Default value:false

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

$cfg['EnableAutocompleteForTablesAndColumns']
Type:布尔值
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:布尔值
Default value:true

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

$cfg['SQLQuery']['Explain']
Type:布尔值
Default value:true

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

$cfg['SQLQuery']['ShowAsPHP']
Type:布尔值
Default value:true

Whether to display a link to wrap a query in PHP code in any SQL Query box.

$cfg['SQLQuery']['Refresh']
Type:布尔值
Default value:true

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

Web server upload/save/import directories

If PHP is running in safe mode, all directories must be owned by the same user as the owner of the phpMyAdmin scripts.

If the directory where phpMyAdmin is installed is subject to an open_basedir restriction, you need to create a temporary directory in some directory accessible by the PHP interpreter.

For security reasons, all directories should be outside the tree published by webserver. If you cannot avoid having this directory published by webserver, limit access to it either by web server configuration (for example using .htaccess or web.config files) or place at least an empty index.html file there, so that directory listing is not possible. However as long as the directory is accessible by web server, an attacker can guess filenames to download the files.

$cfg['UploadDir']
Type:文本
Default value:''

The name of the directory where SQL files have been uploaded by other means than phpMyAdmin (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, or when file uploads are disabled in PHP.

警告

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

$cfg['SaveDir']
Type:文本
Default value:''

The name of the directory where dumps can be saved.

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

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

警告

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

$cfg['TempDir']
Type:文本
Default value:'./tmp/'

The name of the directory where temporary files can be stored. It is used for several purposes, currently:

This directory should have as strict permissions as possible as the only user required to access this directory is the one who runs the webserver. If you have root privileges, simply make this user owner of this directory and make it accessible only by it:

chown www-data:www-data tmp
chmod 700 tmp

If you cannot change owner of the directory, you can achieve a similar setup using ACL:

chmod 700 tmp
setfacl -m "g:www-data:rwx" tmp
setfacl -d -m "g:www-data:rwx" tmp

If neither of above works for you, you can still make the directory chmod 777, but it might impose risk of other users on system reading and writing data in this directory.

警告

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

Various display setting

$cfg['RepeatCells']
Type:整数
Default value:100

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

$cfg['QueryHistoryDB']
Type:布尔值
Default value:false
$cfg['QueryHistoryMax']
Type:整数
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['BrowseMIME']
Type:布尔值
Default value:true

启用 转换.

$cfg['MaxExactCount']
Type:整数
Default value:50000

For InnoDB tables, determines for how large tables phpMyAdmin 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.

在 4.8.0 版更改: The default value was lowered to 50000 for performance reasons.

在 4.2.6 版更改: The default value was changed to 500000.

$cfg['MaxExactCountViews']
Type:整数
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:布尔值
Default value:true

Sorts database and table names according to natural order (for example, t1, t2, t10). Currently implemented in the navigation panel and in Database view, for the table list.

$cfg['InitialSlidersState']
Type:文本
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:数组
Default value:array()

Contains names of configuration options (keys in $cfg array) that users can’t set through user preferences. For possible values, refer to clases under libraries/classes/Config/Forms/User/.

$cfg['UserprefsDeveloperTab']
Type:布尔值
Default value:false

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

页面标题

$cfg['TitleTable']
Type:文本
Default value:'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'
$cfg['TitleDatabase']
Type:文本
Default value:'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'
$cfg['TitleServer']
Type:文本
Default value:'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'
$cfg['TitleDefault']
Type:文本
Default value:'@HTTP_HOST@ | @PHPMYADMIN@'

Allows you to specify window’s title bar. You can use 6.27 What format strings can I use?.

Theme manager settings

$cfg['ThemeManager']
Type:布尔值
Default value:true

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

$cfg['ThemeDefault']
Type:文本
Default value:'pmahomme'

The default theme (a subdirectory under ./themes/).

$cfg['ThemePerServer']
Type:布尔值
Default value:false

Whether to allow different theme for each server.

$cfg['FontSize']
Type:文本
Default value:‘82%’

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:文本
Default value:'SELECT * FROM @TABLE@ WHERE 1'
$cfg['DefaultQueryDatabase']
Type:文本
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:数组
Default value:array(…)

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.

Default options for Transformations

$cfg['DefaultTransformations']
Type:数组
Default value:An array with below listed key-values
$cfg['DefaultTransformations']['Substring']
Type:数组
Default value:array(0, ‘all’, ‘…’)
$cfg['DefaultTransformations']['Bool2Text']
Type:数组
Default value:array(‘T’, ‘F’)
$cfg['DefaultTransformations']['External']
Type:数组
Default value:array(0, ‘-f /dev/null -i -wrap -q’, 1, 1)
$cfg['DefaultTransformations']['PreApPend']
Type:数组
Default value:array(‘’, ‘’)
$cfg['DefaultTransformations']['Hex']
Type:数组
Default value:array(‘2’)
$cfg['DefaultTransformations']['DateFormat']
Type:数组
Default value:array(0, ‘’, ‘local’)
$cfg['DefaultTransformations']['Inline']
Type:数组
Default value:array(‘100’, 100)
Type:数组
Default value:array(‘’, 100, 50)
Type:数组
Default value:array(‘’, ‘’, ‘’)

Console settings

注解

These settings are mostly meant to be changed by user.

$cfg['Console']['StartHistory']
Type:布尔值
Default value:false

在开始时显示查询历史

$cfg['Console']['AlwaysExpand']
Type:布尔值
Default value:false

总是扩展查询消息

$cfg['Console']['CurrentQuery']
Type:布尔值
Default value:true

显示当前浏览查询

$cfg['Console']['EnterExecutes']
Type:布尔值
Default value:false

使用Enter执行查询,使用Shift + Enter插入新行

$cfg['Console']['DarkTheme']
Type:布尔值
Default value:false

切换到黑色主题

$cfg['Console']['Mode']
Type:文本
Default value:‘info’

控制台模式

$cfg['Console']['Height']
Type:整数
Default value:92

控制台高度

开发

警告

These settings might have huge effect on performance or security.

$cfg['DBG']
Type:数组
Default value:array(…)
$cfg['DBG']['sql']
Type:布尔值
Default value:false

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

$cfg['DBG']['sqllog']
Type:布尔值
Default value:false

Enable logging of queries and execution times to the syslog. Requires $cfg['DBG']['sql'] to be enabled.

$cfg['DBG']['demo']
Type:布尔值
Default value:false

Enable to let server present itself as demo server. This is used for 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:布尔值
Default value:false

可以使用:ref:`simple2fa`来测试双因素身份验证。

Examples

See following configuration snippets for typical setups of phpMyAdmin.

Basic example

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

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <https://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */
declare(strict_types=1);

/**
 * This is needed for cookie based authentication to encrypt password in
 * cookie. Needs to be 32 chars long.
 */
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/**
 * Servers configuration
 */
$i = 0;

/**
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/**
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

/**
 * End of servers configuration
 */

/**
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

/**
 * 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'.
 * default = 'both'
 */
//$cfg['RowActionType'] = 'icons';

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * Possible values: 25, 50, 100, 250, 500
 * default = 25
 */
//$cfg['MaxRows'] = 50;

/**
 * Disallow editing of binary fields
 * valid values are:
 *   false    allow editing
 *   'blob'   allow editing except for BLOB fields
 *   'noblob' disallow editing except for BLOB fields
 *   'all'    disallow editing
 * default = 'blob'
 */
//$cfg['ProtectBinary'] = false;

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 * When using DB-based query history, how many entries should be kept?
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/**
 * Whether or not to query the user before sending the error report to
 * the phpMyAdmin team when a JavaScript error occurs
 *
 * Available options
 * ('ask' | 'always' | 'never')
 * default = 'ask'
 */
//$cfg['SendErrorReports'] = 'always';

/**
 * You can find more configuration options in the documentation
 * in the doc/ folder or at <https://docs.phpmyadmin.net/>.
 */

警告

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 examples/signon.php to demonstrate usage of Signon 认证方式:

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

Example for IP address limited autologin

If you want to automatically login when accessing phpMyAdmin locally while asking for a password when accessing remotely, you can achieve it using following snippet:

if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'yourpassword';
} else {
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
}

注解

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:

<?php
$cfg['blowfish_secret']='multiServerExample70518';
//any string of your choice
$i = 0;

$i++; // server 1 :
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose']   = 'no1';
$cfg['Servers'][$i]['host']      = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysqli';
// more options for #1 ...

$i++; // server 2 :
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose']   = 'no2';
$cfg['Servers'][$i]['host']      = 'remote.host.addr';//or ip:'10.9.8.1'
// this server must allow remote clients, e.g., host 10.9.8.%
// not only in mysql.host but also in the startup configuration
$cfg['Servers'][$i]['extension'] = 'mysqli';
// more options for #2 ...

// end of server sections
$cfg['ServerDefault'] = 0; // to choose the server on startup

// further general options ...
?>

Google Cloud SQL with SSL

To connect to Google Could SQL, you currently need to disable certificate verification. This is caused by the certficate being issued for CN matching your instance name, but you connect to an IP address and PHP tries to match these two. With verfication you end up with error message like:

Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8'

警告

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

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

// IP address of your instance
$cfg['Servers'][$i]['host'] = '8.8.8.8';
// Use SSL for connection
$cfg['Servers'][$i]['ssl'] = true;
// Client secret key
$cfg['Servers'][$i]['ssl_key'] = '../client-key.pem';
// Client certificate
$cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem';
// Server certification authority
$cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem';
// Disable SSL verification (see above note)
$cfg['Servers'][$i]['ssl_verify'] = false;