这是一份 phpMyAdmin 文档的翻译。你可以到翻译服务器来帮助我们完善它。

环境需求

介绍

在有超级用户的情况下,phpMyAdmin 可以像管理一个数据库一样管理整个 MySQL 服务器。要实现这些功能你需要正确设置 MySQL 用户能够读/写的数据库。你可以在 MySQL 手册中找到相关内容。

目前 phpMyAdmin 具有的功能有:

关于用户:

很多人难以理解 phpMyAdmin 用户的概念。当一个用户登录到 phpMyAdmin 的时候,用户名和密码是被直接发送到 MySQL 的。phpMyAdmin 本身并没有任何用户管理行为 (有 MySQL 管理权限的用户可以通过 phpMyAdmin 管理其他的 MySQL 用户),所有用户必须是有效的 MySQL 用户。

1) 若 PHP 有 zlib (--with-zlib) 和/或 bzip2 (--with-bz2) 扩展 (可能还需要修改 php.ini)。phpMyAdmin 在转储和导出 CSV 时可压缩成 (zip、gzip -RFC 1952- 或 bzip2 格式)。

安装

  1. 快速安装
  2. 使用安装脚本
  3. phpMyAdmin 高级功能
  4. 从旧版本升级
  5. 使用认证

phpMyAdmin 不会在 MySQL 数据库服务器上应用任何特殊的安全措施。正确设置 MySQL 数据库的权限是系统管理员应该做的。phpMyAdmin 的 "权限" 页面可以帮助系统管理员设置权限。

Mac 用户注意:
如果你使用的 Mac OS 版本低于 OS X,StuffIt 会把文件解压成 Mac 格式。
因为 PHP 好像不支持 Mac 式的换行符 ("\r"),所以在上传到服务器之前,你必须把所有 phpMyAdmin 脚本用 BBEdit 重新保存为 Unix 格式。

快速安装

  1. 从 phpmyadmin.net 下载页选择一个合适的版本。有些版本只有英语,有些只使用 UTF-8 编码且包含了所有语言 (适用于大多数情况),还有些包含了所有语言和所有编码。现在我们假设你选择的是一个像 phpMyAdmin-x.x.x-all-languages.tar.gz 这样名字的版本。
  2. 解开这个压缩包 (连同子目录一起解压): 在你网站服务器的文档根目录执行 tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz 。如果你没有直接的访问服务器的权限,先把这些文件解压到你自己的电脑上,等完成第 4 步之后,再通过 ftp 等方式上传到你的网站服务器上。
  3. 确保所有的脚本都有正确的所有者 (如果 PHP 运行于安全模式,所有者的不同可能会导致问题)。参见 FAQ 4.2FAQ 1.26
  4. 现在你需要做一些设置。通常我们会手动编辑一份 config.inc.php 的副本,但现在我们为那些喜欢使用图形界面安装的用户提供了一个向导式的安装脚本。手动创建 config.inc.php 仍然是一个快速安装的方法,而且一些高级功能也需要手动编辑。
    • 要手动创建 config.inc.php,首先你要有一个文本编辑器 (你可以复制 phpMyAdmin 主目录 (顶层,包含 index.php 的目录) 的 config.sample.inc.php 获得包含最小配置的配置文件。phpMyAdmin 首先会加载 libraries/config.default.php 中的默认设置,然后再用 config.inc.php 中的设置覆盖。如果默认值就是你所需要的,那就不用在 config.inc.php 里面再写一遍了。一个简单的设置如下:
      <?php
      $cfg['blowfish_secret'] = 'ba17c1ec07d65003';  // 此值可任意修改
      
      $i=0;
      $i++;
      $cfg['Servers'][$i]['auth_type']     = 'cookie';
      ?>
      
      或者,如果你不想每次都登录:
      <?php
      
      $i=0;
      $i++;
      $cfg['Servers'][$i]['user']          = 'root';
      $cfg['Servers'][$i]['password']      = 'cbb74bc'; // 这里填写你的密码
      $cfg['Servers'][$i]['auth_type']     = 'config';
      ?>
      
      完整的设置说明请参见本文档的 设置 一节。
    • 不想手动编辑 config.inc.php 的话,你可以使用 安装脚本 来代替。为了安全,首先你要在 phpMyAdmin 目录下创建一个 config 文件夹。在 Linux/Unix 系统上你可以使用以下命令:
      cd phpMyAdmin
      mkdir config                        # 创建保存配置文件的目录
      chmod o+rw config                   # 授予所有人对这个目录的写入权限
      
      如果要修改一个现有的配置文件,先将其复制到目录中:
      cp config.inc.php config/           # 复制当前的配置文件以编辑
      chmod o+w config/config.inc.php     # 授予所有人对这个文件的写入权限
      
      在其他平台上, 创建目录并确保网站服务器可以读写即可。参见 FAQ 1.26

      接下来,在浏览器中打开 setup/。要注意的是,在点 设置 区域的 保存之前,所有修改不会被保存。通常安装脚本都可以保存新的 config.inc.php 到 config/ 目录,但在有些权限不正确的服务器上你会看到 "无法加载或保存配置" 的错误提示。请确保 config/ 目录存在并有正确的权限,或使用 下载 把配置文件下载下来再通过 FTP 等方式上传到正确的位置。

      为了安全,在保存之后,就要把配置文件移出 config/ 目录并且重新设置权限:
      mv config/config.inc.php .         # 移动配置文件到当前目录
      chmod o-rw config.inc.php          # 撤销所有人对配置文件的读写权限
      rm -rf config                      # 删除不需要的目录
      
      现在配置文件保存好了。如果你要检查当前设置或者要设置一些安装脚本中没有提供的高级功能,你可以用你最喜欢的编辑器来编辑它。
  5. 如果使用 "config" 认证,你应该保护好 phpMyAdmin 的安装目录,因为 config 认证不会要求用户输入密码。我们建议使用其他认证,如在 .htaccess 文件中设置 HTTP 认证或修改设置让 phpMyAdmin 使用 cookie/http 认证。更多信息参见 FAQ 中的 多用户 一节,特别要注意 FAQ 4.4 中所提到的问题。
  6. 在浏览器中打开 phpMyAdmin 主目录。现在 phpMyAdmin 应该显示一个欢迎页面和你的数据库,如果使用 HTTP 或 cookie 认证,则将显示一个登录对话框。
  7. 你应该在你的网站服务器中设置禁止对 ./libraries./setup/lib 这两个子目录的访问。在 Apache 中你可以通过 .htaccess 文件设置,其他网站服务器请自行设置。通过设置来预防可能的路径泄露以及跨占脚本攻击,加强服务器的安全性。
  8. 禁止搜索引擎访问公开的 phpMyAdmin 是个好方法,因为这对它们没有任何用处。你可以使用网站服务器根目录的 robots.txt 文件或直接从网站服务器设置中限制其访问。你可以在 contrib 目录下找到 .htaccess 文件的范例。

phpMyAdmin 高级功能

若要使用一些高级功能 (如: 书签、注释、SQL 查询历史、结构追踪、生成 PDF 、内容转换等),你需要创建一些特殊的数据表。这些表可以放在你自己的数据库里,也可以在一个多用户的服务器上创建一个独立的数据库 (这个数据库将通过其对应的帐号访问,所以不应该给其他用户访问这个数据库的权限)。

你可以在 ./scripts/ 目录下找到 create_tables.sql 文件 (如果你使用的是 Windows 服务器,请特别注意在 FAQ 1.23 中所提到的问题)。

如果你以前就使用过该功能并升级过 MySQL 到 4.1.2 或更高版本,请使用 ./scripts/upgrade_tables_mysql_4_1_2+.sql 然后通过导入 ./scripts/create_tables.sql 来创建新的数据表。

你可以使用 phpMyAdmin 来创建这些数据表。但请注意,你可能需要特殊 (管理员) 权限来创建数据库和数据表,而且可能还需要根据实际所使用的数据修改这个脚本中数据库的名字。

在导入 ./scripts/create_tables.sql 文件之后,就可以根据数据表的名字修改 ./config.inc.php 配置文件。需要使用到的配置可以在 设置 一节中找到。同时还要有一个在那些表上具有相应权限的控制用户 (参见下面的 使用认证 一节)。

从旧版本升级

只需复制旧版本的 ./config.inc.php 到新版本即可。当某些选项被改变或取消时,也可能需要做一些修改,特别是 $cfg['AttributeTypes'] 的定义被修改了,所以你最好将它从你的配置文件中删除,使用默认值。为了兼容 PHP 6,还需要删除可能出现在配置文件的末尾的 set_magic_quotes_runtime(0); 语句。

请勿复制 libraries/config.default.phpconfig.inc.php 因为默认配置是仅对当前版本有效的。

如果你把 MySQL 服务器从 4.1.2 之前的版本升级到了 5.x 或更高版本,并且使用 phpMyAdmin 高级功能,你还要运行 SQL 脚本 scripts/upgrade_tables_mysql_4_1_2+.sql

使用认证

'HTTP' 认证

'cookie' 认证

'signon' 认证

'config' 认证

Swekey 认证

Swekey 是可用于网站应用程序上的廉价 USB 证书。

当开启 Swekey 认证时,需要在进入 phpMyAdmin 的登录页面前插入 Swekey (目前仅支持 cookie 认证)。Swekey 认证默认为关闭。

config.inc.php 中添加如下内容可启用 Swekey 认证:

$cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey.conf';

然后你要创建用来保存每个用户 Swekey 标识的文件 swekey.conf 。这个文件不应该放在网站服务器的文档根目录 (在例子中,我们把它放在了 /etc) 。在 contrib 目录下可以找到一个带有说明的范例文件。欢迎使用你自己的用户信息。

如果你想购买 Swekey 请访问 http://phpmyadmin.net/auth_key (外链,英语),通过此链接购买 phpMyAdmin 将会得到捐助。

设置

Mac 用户注意: PHP 似乎不支持 Mac 式的换行符 ("\r")。所以在保存你所修改的文件之前,请确保你的文本编辑器使用 *nix 式的换行符 ("\n")。

注意: 几乎所有设置都在 config.inc.php 文件中定义。如果此文件不存在,请参考快速安装一节创建该文件。你只需要设置不同于 libraries/config.default.php 中所定义的默认值的设置。

与设计相关的参数 (如颜色) 是通过 themes/主题名/layout.inc.php 定义的。你可能还需要创建 config.footer.inc.phpconfig.header.inc.php 文件用来添加你的代码到每一页的页眉和页脚。

$cfg['PmaAbsoluteUri'] 字符串
在这里设置 phpMyAdmin 安装目录的完整 URL 。如, http://www.your_web.net/path_to_your_phpMyAdmin_directory/ 。注意在有些网站服务器上 URL 是区分大小写的。不要忘了最后的斜杠。

自 2.3.0 起,我们建议将本设置留空。大多数情况下 phpMyAdmin 能正确地自动识别。使用端口转发的用户需要设置 PmaAbsoluteUri (详细信息 (外链,英语))。通过浏览一张数据表、编辑并保存一条记录可以测试出自动识别是否有问题。如果有问题 phpMyAdmin 会有错误信息。如果你收到了必须设置或自动识别失败的错误,请给我们提交一份缺陷 (bug) 报告以便我们能改进这个功能。
$cfg['PmaNoRelation_DisableWarning'] 布尔
自 2.3.0 起 phpMyAdmin 提供了一系列关于主/外表的功能 (参见 $cfg['Servers'][$i]['pmadb'])。
如果你尝试使用这些功能但无法正常使用,请在你想使用该功能的数据库中打开"结构"页。你会看到一个可以告诉你为什么这些功能无法使用的链接。
如果你不想使用那些功能,将此值设为 TRUE 即可隐藏那些提示信息。
$cfg['SuhosinDisableWarning'] 布尔
设为 TRUE 可在检测到 Suhosin 时不显示警告。
$cfg['McryptDisableWarning'] 布尔
设为 TRUE 可在使用 cookie 认证但没有 mcrypt 扩展时不显示警告。
$cfg['TranslationWarningThreshold'] 整数
对不到特定完成度的翻译显示警告。
$cfg['AllowThirdPartyFraming'] 布尔
设为 true 将允许 phpMyAdmin 被不同域名的框架所调用,这个潜在的安全漏洞可能导致跨框架脚本攻击。
$cfg['blowfish_secret'] 字符串
"cookie" 认证使用 blowfish 算法加密用户的密码。
若要使用 "cookie" 认证,需要设置一个随机的密钥。这是 blowfish 算法内部使用的,以后也不会向你询问。字数不限。

自 3.1.0 起 phpMyAdmin 能在线生成,但因为密钥被保存在会话中,所以安全性相对较低,并且无法显示上次登录的用户名。
$cfg['Servers'] 数组
自 1.4.2 起,phpMyAdmin 支持管理多个 MySQL 服务器。因此加入了 $cfg['Servers'] 数组来保存不同服务器的登录信息。第一个 $cfg['Servers'][$i]['host'] 包含第一个服务器的主机名,第二个 $cfg['Servers'][$i]['host'] 包含第二个服务器的主机名,以此类推。在 ./libraries/config.default.php 中有一节服务器的配置,你可以将它多次复制到 ./config.inc.php 中,完全复制或仅复制需要的部分 (要修改的部分)。
$cfg['Servers'][$i]['host'] 字符串
第 $i 个 MySQL 服务器的主机名或 IP 地址。如 localhost 。
$cfg['Servers'][$i]['port'] 字符串
第 $i 个 MySQL 服务器的端口号。留空为默认即 3306 。如果使用 "localhost" 作为主机名,MySQL 将忽略端口号转而使用套接字连接,所以如果你想连接到非默认端口,请将 $cfg['Servers'][$i]['host'] 设为 "127.0.0.1" 或者真实的主机名。
$cfg['Servers'][$i]['socket'] 字符串
套接字的路径。留空为默认。
要知道正确的套接字,可以查看 MySQL 的配置或者在 mysql 客户端命令行中执行 status 命令。
$cfg['Servers'][$i]['ssl'] 布尔
设置连接到 MySQL 服务器时是否使用 SSL 安全连接。
$cfg['Servers'][$i]['connect_type'] 字符串
设置怎样连接到 MySQL 服务器。可选 'socket''tcp' 。默认为 'tcp',所有 MySQL 服务器都可以使用,而套接字在有些平台上不可用。

要使用套接字连接,MySQL 服务器必须和网站服务器在同一台服务器上。
$cfg['Servers'][$i]['extension'] 字符串
设置使用什么 PHP 扩展连接到 MySQL。可供选择的有:

mysql : The classic MySQL extension.

mysqli : The improved MySQL extension. This extension became available with PHP 5.0.0 and is the recommended way to connect to a server running MySQL 4.1.x or newer.
$cfg['Servers'][$i]['compress'] 布尔
设置是否使用压缩协议连接到 MySQL 服务器 (试验性的)。
$cfg['Servers'][$i]['controlhost'] string
Permits to use an alternate host to hold the configuration storage data.
$cfg['Servers'][$i]['controluser'] 字符串
$cfg['Servers'][$i]['controlpass'] 字符串
这个特殊的帐号有两种不同的用途: 1、为 phpMyAdmin 高级功能提供支持 (参见 $cfg['Servers'][$i]['pmadb'])。2、在运行于 --skip-show-database 模式的 MySQL 服务器上使用多用户安装提供支持 (HTTP 或 cookie 认证)。

当使用 HTTP 或 cookie 认证时 (自 2.2.1 起也包括 'config' 认证),你需要提供一个在 mysql.user (除了 "Password" 之外的所有字段)mysql.db (所有字段)mysql.tables_priv (除了 "Grantor" 和 "Timestamp" 之外的所有字段) 表上具有 SELECT 权限的 MySQL 帐号,以便检查用户可以看到哪些数据库。
详细信息请参见安装一节中的"使用认证"。

在 2.2.5 前,这两个设置名分别为 "stduser/stdpass" 。
$cfg['Servers'][$i]['auth_type'] 字符串 ['HTTP'|'http'|'cookie'|'config'|'signon']
设置服务器使用 config、cookie、HTTP 还是 signon 认证。
  • 'config' 认证 ($auth_type = 'config') 是最经典的方法: 用户名和密码被保存在 config.inc.php 中。
  • 'cookie' 认证 ($auth_type = 'cookie') 自 2.2.3 起允许在 cookies 的支持下使用任意有效的 MySQL 用户登录。会话中的用户名和密码被保存在 cookies 中,会话结束后密码将被删除。若启用 $cfg['AllowArbitraryServer'] 则可登录到任意服务器。
  • 'HTTP' 认证 (旧版本中曾被称为 'advanced' 认证,也可写作 'http') ($auth_type = 'HTTP') 自 1.3.0 起允许通过任意有效的 MySQL 用户登录。
  • 'signon' authentication mode ($auth_type = 'signon') as introduced in 2.10.0 allows you to log in from prepared PHP session data or using supplied PHP script. This is useful for implementing single signon from another application. Sample way how to seed session is in signon example: scripts/signon.php. There is also alternative example using OpenID - scripts/openid.php and example for scripts based solution - scripts/signon-script.php. You need to configure session name or script to be executed and signon URL to use this authentication method.
详细信息请参见安装一节中的"使用认证"。
$cfg['Servers'][$i]['auth_http_realm'] 复制
当使用 'HTTP' 时,可通过本设置自定义在要求 HTTP 基本认证时用户所收到的提示信息。若未设置,将使用 "phpMyAdmin " 与 $cfg['Servers'][$i]['verbose']$cfg['Servers'][$i]['host'] 作为提示信息。
$cfg['Servers'][$i]['auth_swekey_config'] 字符串
包含用于硬件认证的 Swekey 标识和登录名的文件名。不使用请留空。
$cfg['Servers'][$i]['user'] 字符串
$cfg['Servers'][$i]['password'] 字符串
使用 'config' 认证时用来连接到 MySQL 服务器的用户名和密码。使用 HTTP 或 cookie 认证时请留空,不需要填写。
$cfg['Servers'][$i]['nopassword'] 布尔
设置使用密码登录失败时是否允许尝试使用空密码登录。可与 http 认证同时使用,或通过其他方式完成认证使得 phpMyAdmin 取得用户名及空密码来连接到 MySQL 。然而总是会先尝试使用密码登录的。
$cfg['Servers'][$i]['only_db'] 字符串 或 数组
设置一个 (或一组) 数据库名,用户只能看到这些数据库。自 2.2.1 起,数据库名可以包含 MySQL 通配符 ("_" 和 "%"): 如果你想使用这些字符本身,请转义它们 (即: 要使用 'my\_db' 来表示 'my_db')。
此设置可有效降低服务器的负载,因为不需要向 MySQL 发送构建可用数据库列表的请求。但它并不能取代 MySQL 数据库服务器的权限规则。这仅意味着这些数据库被显示出来而已,而不是说没有显示出来的数据库都不能用。

设置使用多个数据库的例子: $cfg['Servers'][$i]['only_db'] = array('数据库名1', '数据库名2');

自 2.5.5 起,数组中所列出数据库的顺序也被用于在左侧框架排序,所以你可以用它来设置数据库显示的顺序。
若希望让部分数据库置顶显示,不需要列出所有数据库,用: $cfg['Servers'][$i]['only_db'] = array('要置顶的数据库1', '要置顶的数据库2', '*'); 即可,phpMyAdmin 就会将 要置顶的数据库1 和 要置顶的数据库2 置顶显示,而其他数据库还按字母顺序排列。
$cfg['Servers'][$i]['hide_db'] 字符串
对非特权用户隐藏数据库的正则表达式。 这仅仅将数据库从列表中隐藏,用户仍然可以直接访问 (如通过 SQL 查询)。要彻底限制访问,请使用 MySQL 权限系统。

例如,要隐藏所有以字母 "a" 开头的数据库,用
$cfg['Servers'][$i]['hide_db'] = '^a';
要隐藏数据库 "数据库1" 和 "数据库2" ,用
$cfg['Servers'][$i]['hide_db'] = '^(数据库1|数据库2)$';// 译者注: 上例中也可使用中文,需注意配置文件编码应为 UTF-8
可以在 PHP 手册的 Perl 兼容正则表达式的语法 (外链,英语) 一节中找到更多关于正则表达式的信息。
$cfg['Servers'][$i]['verbose'] 字符串
仅在通过 phpMyAdmin 管理多个服务器时有用。主页的下拉菜单中将用此值代替主机名。如果你想只显示系统中部分数据库时也有用,如,使用 HTTP 认证时,所有非 ASCII 字符都将被删除。
$cfg['Servers'][$i]['pmadb'] 字符串
包含 phpMyAdmin 高级功能数据的数据库名。

参见 phpMyAdmin 高级功能一节了解其好处以及如何快速创建该数据库和需要的数据表。

如果此 phpMyAdmin 只有你自己使用,你可以用你当前的数据库来保存这些特殊的数据表,这种情况下,你可以在 $cfg['Servers'][$i]['pmadb'] 中填写当前数据库的名字。若此 phpMyAdmin 作为多用户使用,请设为包含 phpMyAdmin 高级功能数据表的专用数据库。
$cfg['Servers'][$i]['bookmarktable'] 字符串
自 2.2.0 起 phpMyAdmin 允许用户将查询加入书签。你可以将经常要执行的语句加入书签。

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['bookmarktable'] 中设置要使用的数据表名
$cfg['Servers'][$i]['relation'] 字符串
自 2.2.4 起你可以在 'relation' 表的支持下定义一张表中的一个字段与另一张表的关系 (外键)。目前 phpMyAdmin 用它来
  • 使外键数据可点击,浏览主表时可通过点击数据值转到外表;
  • 在浏览主表时,当鼠标移到含有外键的字段上用气泡提示显示可选的"显示的字段" (需同时使用 'table_info' 表);
    (参见 FAQ 6.7)
  • 在编辑/插入时,显示可能的外键下拉列表 (显示为键值和"显示的字段")
    (参见 FAQ 6.21)
  • 在表的属性页上为每个键显示检查参照完整性的链接(用于显示缺失的外键);
  • 通过依例查询自动创建关联查询 (参见 FAQ 6.6)
  • 生成 PDF 格式的数据库大纲 (需同时使用 table_coords 表)。
字段值可以是数字或者字符。

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['relation'] 中设置要使用的数据表名
  • 现在以普通用户登录到 phpMyAdmin 并打开每一张你想要使用这个功能的数据表,点击"结构/关系查看/"并设置外键字段。
请注意在当前版本中 master_db 必须和 foreign_db 一致。这两个字段是为后期跨数据库关系开发预留的。
$cfg['Servers'][$i]['table_info'] 字符串
自 2.3.0 起你可以在 'table_info' 表的支持下设置当鼠标移到对应字段时用气泡提示显示出来的相应内容。
这张表的名字将被保存在此变量中。要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['table_info'] 中设置要使用的数据表名 (如:'pma_table_info')
  • 对每一张你要使用此功能的数据表,点击"结构/关系查看/选择要显示的字段"设置好显示的字段。
使用技巧: 显示字段
$cfg['Servers'][$i]['table_coords'] 字符串
$cfg['Servers'][$i]['pdf_pages'] 字符串
自 2.3.0 起你可以用 phpMyAdmin 创建 PDF 页面来显示各数据表之间的关系。要实现这个功能需要两张数据表,"pdf_pages" (保存可用 PDF 页的信息) 和 "table_coords" (保存每张表在 PDF 大纲输出中的坐标)。

需要 "relation" 功能支持。

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['table_coords']$cfg['Servers'][$i]['pdf_pages'] 中设置要使用的数据表名
使用技巧: PDF 输出
$cfg['Servers'][$i]['column_info'] 字符串
自 2.3.0 起可以为每张数据表保存每个字段的注释。"打印预览"会用到此功能。

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.

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

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['column_info'] 中设置要使用的数据表名 (如:'pma_column_info')
  • 要从 2.5.0 之前的 Column_comments 表升级可执行:
    ALTER TABLE `pma_column_comments`
        ADD `mimetype` VARCHAR( 255 ) NOT NULL,
        ADD `transformation` VARCHAR( 255 ) NOT NULL,
        ADD `transformation_options` VARCHAR( 255 ) NOT NULL;
    
    别忘了将 config.inc.php 中的
    $cfg['Servers'][$i]['column_comments'] 改为 $cfg['Servers'][$i]['column_info']
$cfg['Servers'][$i]['history'] 字符串
自 2.5.0 起可以保存你在 phpMyAdmin 中输入的 SQL 查询历史。如果你不想使用基于数据表的历史记录,也可以使用基于 JavaScript 的历史记录。但当你关闭窗口时,所有历史记录都将被删除。

通过 $cfg['QueryHistoryMax'] 可以定义保存历史记录的最大数量。过量历史记录的删除操作将在每次登录时执行。

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

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['history'] 中设置要使用的数据表名 (如:'pma_history')
$cfg['Servers'][$i]['recent'] string
Since release 3.5.0 you can show recently used tables in the left navigation frame. It helps you to jump across table directly, without the need to select the database, and then select the table. Using $cfg['LeftRecentTable'] you can configure the maximum number of recent tables shown. When you select a table from the list, it will jump to the page specified in $cfg['LeftDefaultTabTable'].

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:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • put the table name in $cfg['Servers'][$i]['recent'] (e.g. 'pma_recent')
$cfg['Servers'][$i]['table_uiprefs'] string
Since release 3.5.0 phpMyAdmin 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:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • put the table name in $cfg['Servers'][$i]['table_uiprefs'] (e.g. 'pma_table_uiprefs')
$cfg['Servers'][$i]['tracking'] 字符串
自 3.3.x 起可以使用追踪功能。它可以帮你追踪每个通过 phpMyAdmin 执行的 SQL 命令。它支持记录数据修改和数据定义语句。启用后还可以创建数据表的版本。

创建版本会造成两个影响:
  • phpMyAdmin 保存当前数据表的快照,包括结构和索引。
  • phpMyAdmin 针对当前数据表记录的所有修改结构和/或数据的命令都将与版本关联。
当然你也能查看追踪到的修改。在"追踪"页里每个版本都会有一份完整的报告。你可以在报告中搜索,如你可以只列出一段时间内的语句。若想根据用户名搜索可以输入 * 表示任意用户或者输入 ',' 分隔的用户列表。你还可以导出 (包括搜索结果) 报告为文件或者临时数据库。

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['tracking'] 中设置要使用的数据表名 (如:'pma_tracking')
$cfg['Servers'][$i]['tracking_version_auto_create'] 布尔
设置追踪系统是否自动为数据表和视图创建版本。默认为 false 。

若设为 true 然后你通过
  • CREATE TABLE ...
  • CREATE VIEW ...
创建了一张表或视图并且它当前没有任何版本,系统将会自动为你创建一个版本。
$cfg['Servers'][$i]['tracking_default_statements'] 字符串
定义自动创建新版的命令列表。默认值为
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'] 布尔
设置当记录视图创建时,是否在日志首行加上 DROP VIEW IF EXISTS 语句。默认为 true 。

$cfg['Servers'][$i]['tracking_add_drop_table'] 布尔
设置当记录数据表创建时,是否在日志首行加上 DROP TABLE IF EXISTS 语句。默认为 true 。

$cfg['Servers'][$i]['tracking_add_drop_database'] 布尔
设置当记录数据库创建时,是否在日志首行加上 DROP DATABASE IF EXISTS 语句。默认为 true 。

$cfg['Servers'][$i]['userconfig'] 字符串
自 3.4.x 起 phpMyAdmin 允许用户自己设置大部分偏好并将设置保存在数据库中。

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

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['userconfig'] 中设置要使用的数据表名
$cfg['Servers'][$i]['designer_coords'] 字符串
自 2.10.0 起可以通过设计器可视化地管理关系。

要启用此功能:
  • 设置好 pmadb 和 phpMyAdmin 高级功能
  • $cfg['Servers'][$i]['designer_coords'] 中设置要使用的数据表名 (如:'pma_designer_coords')
$cfg['Servers'][$i]['MaxTableUiprefs'] integer
Maximum number of rows saved in $cfg['Servers'][$i]['table_uiprefs'] table.

When tables are dropped or renamed, table_uiprefs may contain invalid data (referring to tables which no longer exist).
We only keep this number of newest rows in table_uiprefs and automatically delete older rows.
$cfg['Servers'][$i]['verbose_check'] 布尔
因自 2.5.0 起采用了新的 MIME 类型转换功能,使 column_info 表增加了三个字段。若上述变量设为 TRUE (默认值),phpMyAdmin 将会检查你的表结构是否已更新。若没有,则会给超级用户显示警告。

你可以通过将其设为 false 来禁止此检查,从而得到性能的提升。

当你确定你的表结构是最新的时,我们建议将其设为 FALSE 。
$cfg['Servers'][$i]['AllowRoot'] 布尔
设置是否允许 root 用户访问。此为以下 AllowDeny rules 的快速设置。
$cfg['Servers'][$i]['AllowNoPassword'] 布尔
设置是否允许使用空密码登录。为了防止可能存在空密码的 root 或者其他匿名 (空) 用户访问到 MySQL 服务器,此项默认为 false
$cfg['Servers'][$i]['AllowDeny']['order'] 字符串
若不指定规则顺序,IP 认证将不可用。

若将规则顺序设为 'deny,allow',系统将首先应用所有的允许 (allow) 规则,然后再应用禁止规则 (deny) 。默认允许访问。任何没有被 Deny (禁止) 命令匹配的客户端或者被 Allow (允许) 命令匹配的客户端将被允许访问服务器。

若将规则顺序设为 'allow,deny',系统将首先应用所有的禁止 (deny) 规则,然后再应用允许 (allow) 规则。默认禁止访问。任何没有被 Allow (允许) 命令匹配的客户端或者被 Deny (禁止) 命令匹配的客户端将被禁止访问服务器。

若将规则顺序设为 'explicit',认证行为与设为 'deny,allow' 相似,但同时额外要求主机/用户名组合必须允许 (allow) 规则中列出且不能在禁止 (deny) 规则中出现。这是安全的方式,并且相当于在 Apache 中使用允许 (allow)、禁止 (deny) 规则但不指定顺序时的效果。

同时请参见 $cfg['TrustedProxies'] 探测使用代理的真实 IP 。
$cfg['Servers'][$i]['AllowDeny']['rules'] 数组 或 字符串
规则的格式通常为:
<'allow' | 'deny'> <用户名> [from] <IP 地址掩码>
如果要匹配所有用户,请在用户名一栏中使用通配符 '%'
有几个 IP 地址掩码 一栏的缩写可以使用 (请注意包含 SERVER_ADDRESS 的条目可能对某些网站服务器无效):
'all' 等价于 0.0.0.0/0
'localhost' 等价于 127.0.0.1/8
'localnetA' 等价于 SERVER_ADDRESS/8
'localnetB' 等价于 SERVER_ADDRESS/16
'localnetC' 等价于 SERVER_ADDRESS/24
在规则顺序为 'deny,allow' 时,空的规则列表等价于 'allow % from all' ;规则顺序为 'allow,deny''explicit' 时等价于 'deny % from all'

对于 IP 匹配系统来说,下列形式是有效的:
xxx.xxx.xxx.xxx (一个具体的 IP 地址)
xxx.xxx.xxx.[yyy-zzz] (一段 IP 地址范围)
xxx.xxx.xxx.xxx/nn (CIDR,无类别域间路由类型的 IP 地址范围)
而下列形式是无效的:
xxx.xxx.xxx.xx[yyy-zzz] (部分 IP 地址范围)
也不支持互联网协议第六版 (IPv6) 的地址。
$cfg['Servers'][$i]['DisableIS'] 布尔
设置是否禁止通过 INFORMATION_SCHEMA 来获取信息 (用 SHOW 命令代替),若不禁止且数据库很多时可能会造成性能下降。目前仅部分代码实现此功能,持续增加中。
$cfg['Servers'][$i]['ShowDatabasesCommand'] 字符串
在有相当数量数据库的服务器上,通过默认的 SHOW DATABASES 命令来查询可用数据库的名字可能会很慢,你可以用更快的命令来代替它 (参见 libraries/config.default.php 文件中的例子)。
$cfg['Servers'][$i]['CountTables'] 布尔
设置是否在导航框架的数据库列表中显示每个数据库中数据表的总数。
$cfg['Servers'][$i]['SignonScript'] string
Name of PHP script to be sourced and executed to obtain login credentials. This is alternative approach to session based single signon. The script needs to provide function get_login_credentials which returns list of username and password, accepting single parameter of existing username (can be empty). See scripts/signon-script.php for an example.
$cfg['Servers'][$i]['SignonSession'] 字符串
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 SignonScript is not configured.
$cfg['Servers'][$i]['SignonURL'] 字符串
使用 signon 认证时用户将转到登录的 URL 。应为包含协议的绝对地址。
$cfg['Servers'][$i]['LogoutURL'] 字符串
使用 signon 认证时用户退出后将转到的 URL (config 认证无效)。应为包含协议的绝对地址。
$cfg['ServerDefault'] 整数
如果有多个服务器设置,你可以设置 $cfg['ServerDefault'] 为其中之一,phpMyAdmin 将会自动连接,若设为 0 则将在登录页面显示服务器列表。
如果只有一个服务器设置,$cfg['ServerDefault'] 必须设为那台服务器。
$cfg['AjaxEnable'] 布尔
设置是否使用 Ajax 技术只刷新某些页面的部分内容。仅用于支持非 Ajax 的页面,例如,设计器功能必须使用 Ajax 所以该指令对其无效。
$cfg['VersionCheck'] 布尔
设置是否允许在 phpMyAdmin 主页面中使用 javascript 检查新版本。
$cfg['MaxDbList'] 整数
导航框架和数据库列表中所显示数据库的最大数量。
$cfg['MaxTableList'] 整数
简洁模式下导航框架和主框架列表 (除导出页) 中所显示数据表的最大数量。
$cfg['ShowHint'] boolean
Whether or not to show hints (for example, hints when hovering over table headers).
$cfg['MaxCharactersInDisplayedSQL'] 整数
显示 SQL 查询的最大字数。默认值 1000 通常可以避免 BLOB 字段中十六进制内容的显示,但有些用户确实有超过 1000 字的 SQL 查询。另外,如果一个查询超过了这个限制,也将不会保存在查询历史中。
$cfg['OBGzip'] 字符串/布尔
设置是否使用 GZip 压缩输出缓冲来加速 HTTP 传输。
设为 true/false 以启/禁用。当设为 'auto' (字符串) 时,phpMyAdmin 将尝试启用输出缓冲并在浏览器对缓冲支持有问题时自动禁用。已知具有特定补丁的 IE6 会在启用缓冲时导致数据损坏。
$cfg['PersistentConnections'] 布尔
Whether persistent connections should be used or not. Works with following extensions:
$cfg['ForceSSL'] 布尔
设置在访问 phpMyAdmin 时是否强制使用 https 安全连接。
$cfg['ExecTimeLimit'] 整数 [单位: 秒]
设置脚本可以运行的时间。若设为 0 则无限制。
本设置用于导入/导出转储文件以及同步功能中,若 PHP 运行于安全模式则无效。
$cfg['SessionSavePath'] 字符串
保存会话数据的路径 (PHP 参数 session_save_path (外链,英语))。
$cfg['MemoryLimit'] 字符串 [单位: 字节]
设置脚本运行的可使用的内存。若设为 0 则无限制。
本设置用于导入/导出转储文件以及 phpMyAdmin 的其他功能,所以显然不要设置一个很小的值。若 PHP 运行于安全模式则无效。
同样可以设置为 php.ini 中可以识别的字符串,如 '16M' 。请确保没有丢掉后缀 (16 表示 16 字节!)
$cfg['SkipLockedTables'] 布尔
标记正在使用的表以使得可以显示含有已锁定表的数据库 (自 MySQL 3.23.30 起) 。
$cfg['ShowSQL'] 布尔
设置是否显示 phpMyAdmin 生成的 SQL 查询语句。
$cfg['RetainQueryBox'] boolean
Defines whether the SQL query box should be kept displayed after its submission.
$cfg['AllowUserDropDatabase'] 布尔
设置普通用户 (非管理员) 是否可以删除他们自己的数据库。若设为 FALSE,链接 "删除数据库" 将不会显示出来,"DROP DATABASE 我的数据库名" 语句也会被忽略。该功能对于有很多客户的 ISP 相当有用。
请注意这里对 SQL 查询的限制并不能像使用 MySQL 权限限制那样严格。因为 SQL 查询可以非常复杂。所以该功能应作为避免误删除数据库而不是严格的权限限制来使用。
$cfg['Confirm'] 布尔
设置当查询可能丢失数据时是否显示警告 ("您真的要 ...") 。
$cfg['LoginCookieRecall'] 布尔
设置在 cookie 认证下是否能自动重复上次登录。

如果没有设置 $cfg['blowfish_secret'] 该功能将自动禁用。
$cfg['LoginCookieValidity'] 整数 [单位: 秒]
设置登录 cookie 的有效期。请注意 PHP 配置选项的 session.gc_maxlifetime 可能会限制会话有效期,若会话失效 cookie 同样会失效。所以最好将 session.gc_maxlifetime 设置为不小于 $cfg['LoginCookieValidity'] 的值。
$cfg['LoginCookieStore'] 整数 [单位: 秒]
设置登录 cookie 应在浏览器中保存多长时间。默认值 0 表示当前会话。建议在公共环境下使用。
$cfg['LoginCookieDeleteAll'] 布尔
若启用 (默认值),退出时将会删除所有服务器的 cookies,否则仅删除当前服务器的 cookies 。若设为 false,当你访问多台服务器时可能会容易忘记退出其它服务器。
$cfg['UseDbSearch'] 布尔
设置是否允许使用 "数据库搜索" 。
$cfg['IgnoreMultiSubmitErrors'] 布尔
设置 phpMyAdmin 是否在执行多语句查询出错的时候继续执行。默认为中断执行。
$cfg['VerboseMultiSubmit'] 布尔
设置 phpMyAdmin 是否以注释形式输出多语句查询中每一个查询的结果到 SQL 输出中。默认值为 TRUE
$cfg['AllowArbitraryServer'] 布尔
若启用,将允许通过 cookie 认证登录到任意服务器并允许在同步对话框中指定服务器。

注意: 请谨慎使用该功能,这将可能导致用户访问到位于 HTTP 服务器防火墙后面的 MySQL 服务器。
$cfg['Error_Handler']['display'] 布尔
设置是否显示 PHP 错误。
$cfg['Error_Handler']['gather'] 布尔
设置是否收集 PHP 错误。
$cfg['LeftFrameLight'] 布尔
Defines whether to use a select-based menu and display only the current tables in the left frame (smaller page). Only in Non-Lightmode you can use the feature to display nested folders using $cfg['LeftFrameTableSeparator']
$cfg['LeftFrameDBTree'] boolean
Defines whether to display the names of databases (in the selector) using a tree, see also $cfg['LeftFrameDBSeparator'].
$cfg['LeftFrameDBSeparator'] string or array
The string used to separate the parts of the database name when showing them in a tree. Alternatively you can specify more strings in an array and all of them will be used as a separator.
$cfg['LeftFrameTableSeparator'] string
Defines a string to be used to nest table spaces. Defaults to '__'. This means if you have tables like 'first__second__third' this will be shown as a three-level hierarchy like: first > second > third. If set to FALSE or empty, the feature is disabled. NOTE: You should not use this separator at the beginning or end of a table name or multiple times after another without any other characters in between.
$cfg['LeftFrameTableLevel'] string
Defines how many sublevels should be displayed when splitting up tables by the above separator.
$cfg['LeftRecentTable'] integer
The maximum number of recently used tables shown in the left navigation frame. Set this to 0 (zero) to disable the listing of recent tables.
$cfg['ShowTooltip'] boolean
Defines whether to display table comment as tool-tip in left frame or not.
$cfg['ShowTooltipAliasDB'] boolean
If tool-tips are enabled and a DB comment is set, this will flip the comment and the real name. That means that if you have a table called 'user0001' and add the comment 'MyName' on it, you will see the name 'MyName' used consequently in the left frame and the tool-tip shows the real name of the DB.
$cfg['ShowTooltipAliasTB'] boolean/string
Same as $cfg['ShowTooltipAliasDB'], except this works for table names. When setting this to 'nested', the Alias of the Tablename is only used to split/nest the tables according to the $cfg['LeftFrameTableSeparator'] directive. So only the folder is called like the Alias, the tablename itself stays the real tablename.
Defines whether or not to display the phpMyAdmin logo at the top of the left frame. Defaults to TRUE.
Enter URL where logo in the navigation frame will point to. For use especially with self made theme which changes this. The default value for this is main.php.
$cfg['LeftLogoLinkWindow'] string
Whether to open the linked page in the main window (main) or in a new one (new). Note: use new if you are linking to phpmyadmin.net.
$cfg['LeftDisplayTableFilterMinimum'] 整数
Defines the minimum number of tables to display a JavaScript filter box above the list of tables in the left frame. Defaults to 30. To disable the filter completely some high number can he used (e.g. 9999)
$cfg['LeftDisplayServers'] boolean
Defines whether or not to display a server choice at the top of the left frame. Defaults to FALSE.
$cfg['DisplayServersList'] boolean
Defines whether to display this server choice as links instead of in a drop-down. Defaults to FALSE (drop-down).
$cfg['DisplayDatabasesList'] boolean or text
Defines whether to display database choice in light navigation frame as links instead of in a drop-down. Defaults to 'auto' - on main page list is shown, when database is selected, only drop down is displayed.
$cfg['LeftDefaultTabTable'] string
设置点击导航框架中每个数据表名字旁边的小图标时所显示的页面。可选值有: "tbl_structure.php"、"tbl_sql.php"、"tbl_select.php"、"tbl_change.php" 或 "sql.php" 。
$cfg['ShowStats'] 布尔
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'] boolean
Defines whether to display detailed server information on main page. You can additionally hide more information by using $cfg['Servers'][$i]['verbose'].
$cfg['ShowPhpInfo'] 布尔
$cfg['ShowChgPassword'] 布尔
$cfg['ShowCreateDb'] 布尔
设置是否在主 (右侧) 框架中显示 "PHP 信息" 、 "修改密码" 链接和创建数据库表单。此设置不检查直接输入的 MySQL 命令。

请注意若要限制脚本使用 phpinfo() 函数,你必须在 php.ini 中设置:
disable_functions = phpinfo()
Also 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['SuggestDBName'] boolean
Defines whether to suggest a database name on the "Create Database" form or to keep the textfield empty.
$cfg['NavigationBarIconic'] string
Defines whether navigation bar buttons and the right panel top menu contain text or symbols only. A value of TRUE displays icons, FALSE displays text and 'both' displays both icons and text.
$cfg['ShowAll'] boolean
Defines whether a user should be displayed a "show all (rows)" button in browse mode or not.
$cfg['MaxRows'] integer
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.
$cfg['Order'] string [DESC|ASC|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.
$cfg['DisplayBinaryAsHex'] boolean
Defines whether the "Show binary contents as HEX" browse option is ticked by default.
$cfg['ProtectBinary'] boolean or string
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;
  • 'all' to disallow editing of all BINARY or BLOB columns.
$cfg['ShowFunctionFields'] boolean
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'] 布尔
Defines whether or not type fields should be initially displayed in edit/insert mode. The user can toggle this setting from the interface.
$cfg['CharEditing'] string
设置编辑 CHAR 和 VARCHAR 类型字段时应使用何种控件。可选值有:
  • 输入框 (input) - 允许限制输入字数使其不超过 MySQL 字段限制,但无法换行
  • 文本框 (textarea) - 可以换行,但没有字数限制
默认为输入框 (input) 。
$cfg['MinSizeForInputField'] integer
Defines the minimum size for input fields generated for CHAR and VARCHAR columns.
$cfg['MaxSizeForInputField'] integer
Defines the maximum size for input fields generated for CHAR and VARCHAR columns.
$cfg['InsertRows'] 整数
Defines the maximum number of concurrent entries for the Insert page.
$cfg['ForeignKeyMaxLimit'] integer
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'] array
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'.
$cfg['ZipDump'] 布尔
$cfg['GZipDump'] 布尔
$cfg['BZipDump'] 布尔
设置在创建转储文件时是否允许使用 zip/GZip/BZip2 压缩
$cfg['CompressOnFly'] 布尔
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['LightTabs'] boolean
If set to TRUE, use less graphically intense tabs on the top of the mainframe.
$cfg['PropertiesIconic'] string
If set to TRUE, 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 FALSE, will only show text.
$cfg['PropertiesNumColumns'] integer
How many columns will be utilized to display the tables on the database property view? Default is 1 column. When setting this to a value larger than 1, the type of the database will be omitted for more display space.
$cfg['DefaultTabServer'] string
Defines the tab displayed by default on server view. Possible values: "main.php" (recommended for multi-user setups), "server_databases.php", "server_status.php", "server_variables.php", "server_privileges.php" or "server_processlist.php".
$cfg['DefaultTabDatabase'] string
Defines the tab displayed by default on database view. Possible values: "db_structure.php", "db_sql.php" or "db_search.php".
$cfg['DefaultTabTable'] string
Defines the tab displayed by default on table view. Possible values: "tbl_structure.php", "tbl_sql.php", "tbl_select.php", "tbl_change.php" or "sql.php".
$cfg['MySQLManualBase'] string
If set to an URL which points to the MySQL documentation (type depends on $cfg['MySQLManualType']), appropriate help links are generated.
See MySQL Documentation page for more information about MySQL manuals and their types.
$cfg['MySQLManualType'] string
Type of MySQL documentation:
  • viewable - "viewable online", current one used on MySQL website
  • searchable - "Searchable, with user comments"
  • chapters - "HTML, one page per chapter"
  • big - "HTML, all on one page"
  • none - do not show documentation links
$cfg['DefaultLang'] 字符串
设置在没有浏览器定义或用户定义的情况下所要使用的默认语言。
locale/code/LC_MESSAGES/phpmyadmin.mo 中应有相应的语言文件。
$cfg['DefaultConnectionCollation'] 字符串
Defines the default connection collation to use, if not user-defined.
See the MySQL documentation for list of possible values. This setting is ignored when connected to Drizzle server.
$cfg['Lang'] 字符串
强制使用的语言。
locale/code/LC_MESSAGES/phpmyadmin.mo 中应有相应的语言文件。
$cfg['FilterLanguages'] 字符串
通过正则表达式限制可用语言列表。例如只允许使用简体中文和英语,可以设置为 '^(zh_CN|en)'
$cfg['RecodingEngine'] 字符串
你可以在这里选择使用哪个函数来转换字符集。可选值有:
  • 自动 (auto) - 自动选择可用的函数 (首先尝试 iconv,然后 recode)
  • iconv - 使用 iconv 或 libiconv 函数
  • recode - 使用 recode_string 函数
  • 无 (none) - 禁止编码转换
默认为自动。
启用编码转换后将会在导出和导入页面显示一个用于选择导出文件字符集的下拉菜单。其默认值来自 $cfg['Export']['charset']$cfg['Import']['charset']
$cfg['IconvExtraParams'] 字符串
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'] 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.
$cfg['TrustedProxies'] array
Lists proxies and HTTP headers which are trusted for IP Allow/Deny. 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'] 字符串
指定 GD >= 2 版本是否可用。它将被用于 MIME 类型转换。
可选值有:
  • auto - automatically detect
  • 是 (yes) - GD 2 函数库可以使用
  • 否 (no) - GD 2 函数库不可用
默认为自动。
$cfg['CheckConfigurationPermissions'] 布尔
通常情况下我们会检查配置文件确保不是所有人都能修改它。然而 phpMyAdmin 可能被安装在非 Windows 服务器的 NTFS 文件系统中,在这种情况下看起来权限是错误的但实际上我们无法检测。此时系统管理员应将该指令设为 FALSE 。默认为 TRUE
$cfg['LinkLengthLimit'] 整数
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 URLs. Default is 1000.
$cfg['DisableMultiTableMaintenance'] boolean
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. Default is false.
$cfg['NaviWidth'] 整数
以像素为单位的导航框架宽度。参见 themes/themename/layout.inc.php
$cfg['NaviBackground'] 字符串 [格式: CSS 背景色]
$cfg['MainBackground'] 字符串 [格式: CSS 背景色]
所有框架的背景样式。 参见 themes/themename/layout.inc.php
$cfg['NaviPointerBackground'] 字符串 [格式: CSS 背景色]
$cfg['NaviPointerColor'] 字符串 [格式: CSS 颜色]
The style used for the pointer in the navi frame. See themes/themename/layout.inc.php.
$cfg['LeftPointerEnable'] 布尔
A value of TRUE activates the navi pointer (when LeftFrameLight is FALSE).
$cfg['Border'] 整数
表格边框大小。参见 themes/themename/layout.inc.php
$cfg['ThBackground'] 字符串 [格式: CSS 背景色]
$cfg['ThColor'] 字符串 [格式: CSS 颜色]
表头样式。参见 themes/themename/layout.inc.php
$cfg['BgOne'] 字符串 [格式: CSS 颜色]
The color (HTML) #1 for table rows. See themes/themename/layout.inc.php.
$cfg['BgTwo'] 字符串 [格式: CSS 颜色]
The color (HTML) #2 for table rows. See themes/themename/layout.inc.php.
$cfg['BrowsePointerBackground'] 字符串 [格式: CSS 颜色]
$cfg['BrowsePointerColor'] 字符串 [格式: CSS 颜色]
$cfg['BrowseMarkerBackground'] 字符串 [格式: CSS 颜色]
$cfg['BrowseMarkerColor'] 字符串 [格式: CSS 颜色]
The colors (HTML) uses for the pointer and the marker in browse mode.
The former feature highlights the row over which your mouse is passing and the latter lets you visually mark/unmark rows by clicking on them. Highlighting / marking a column is done by hovering over / clicking the column's header (outside of the text).
See themes/themename/layout.inc.php.
$cfg['FontFamily'] 字符串
请设置一个有效的 CSS 字体,例如 宋体, sans-serif
See themes/themename/layout.inc.php.
$cfg['FontFamilyFixed'] 字符串
请设置一个有效的 CSS 字体,例如 monospace 。该字体用于文本框 (textarea) 。
See themes/themename/layout.inc.php.
$cfg['BrowsePointerEnable'] 布尔
Whether to activate the browse pointer or not.
$cfg['BrowseMarkerEnable'] 布尔
Whether to activate the browse marker or not.
$cfg['TextareaCols'] 整数
$cfg['TextareaRows'] 整数
$cfg['CharTextareaCols'] 整数
$cfg['CharTextareaRows'] 整数
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'] boolean
Defines whether textarea for LONGTEXT columns should have double size.
$cfg['TextareaAutoSelect'] boolean
Defines if the whole textarea of the query box will be selected on click.
$cfg['LimitChars'] integer
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.
$cfg['RowActionLinks'] string
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). "left" and "right" are parsed as "top" and "bottom" with vertical display mode.
$cfg['DefaultDisplay'] 字符串
There are 3 display modes: horizontal, horizontalflipped and vertical. Define which one is displayed by default. The first mode displays each row on a horizontal line, the second rotates the headers by 90 degrees, so you can use descriptive headers even though columns only contain small values and still print them out. The vertical mode sorts each row on a vertical lineup.
$cfg['RememberSorting'] boolean
If enabled, remember the sorting of each table when browsing them.
$cfg['HeaderFlipType'] 字符串
The HeaderFlipType can be set to 'auto', 'css' or 'fake'. When using 'css' the rotation of the header for horizontalflipped is done via CSS. The CSS transformation currently works only in Internet Explorer.If set to 'fake' PHP does the transformation for you, but of course this does not look as good as CSS. The 'auto' option enables CSS transformation when browser supports it and use PHP based one otherwise.
$cfg['ShowBrowseComments'] boolean
$cfg['ShowPropertyComments'] boolean
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['SQLQuery']['Edit'] boolean
Whether to display an edit link to change a query in any SQL Query box.
$cfg['SQLQuery']['Explain'] boolean
Whether to display a link to explain a SELECT query in any SQL Query box.
$cfg['SQLQuery']['ShowAsPHP'] boolean
Whether to display a link to wrap a query in PHP code in any SQL Query box.
$cfg['SQLQuery']['Validate'] boolean
Whether to display a link to validate a query in any SQL Query box. See also $cfg_SQLValidator.
$cfg['SQLQuery']['Refresh'] boolean
Whether to display a link to refresh a query in any SQL Query box.
$cfg['UploadDir'] string
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 note that if PHP is running in safe mode, this directory must be owned by the same user as the owner of the phpMyAdmin scripts.

See also FAQ 1.16 for alternatives.
$cfg['SaveDir'] string
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 note that if PHP is running in safe mode, this directory must be owned by the same user as the owner of the phpMyAdmin scripts.
$cfg['TempDir'] string
The name of the directory where temporary files can be stored.

This is needed for importing ESRI Shapefiles, see FAQ 6.30 and to work around limitations of open_basedir for uploaded files, see FAQ 1.11.

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 web server. However for security reasons, this directory should be outside the tree published by webserver. If you cannot avoid having this directory published by webserver, place at least an empty index.html file there, so that directory listing is not possible.

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.
$cfg['Export'] 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']['method'] 字符串
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['Import'] 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['SaveCellsAtOnce'] boolean
Defines whether or not to save all edited cells at once in browse-mode.
$cfg['ShowDisplayDirection'] boolean
Defines whether or not type display direction option is shown when browsing a table.
$cfg['RepeatCells'] integer
Repeat the headers every X cells, or 0 to deactivate.
$cfg['EditInWindow'] boolean
$cfg['QueryWindowWidth'] integer
$cfg['QueryWindowHeight'] integer
$cfg['QueryHistoryDB'] boolean
$cfg['QueryWindowDefTab'] string
$cfg['QueryHistoryMax'] integer
All those variables affect the query window feature. A SQL link or icon is always displayed on the left panel. If JavaScript is enabled in your browser, a click on this opens a distinct query window, which is a direct interface to enter SQL queries. Otherwise, the right panel changes to display a query box.

The size of this query window can be customized with $cfg['QueryWindowWidth'] and $cfg['QueryWindowHeight'] - both integers for the size in pixels. Note that normally, those parameters will be modified in layout.inc.php for the theme you are using.

If $cfg['EditInWindow'] is set to true, a click on [Edit] from the results page (in the "Showing Rows" section) opens the query window and puts the current query inside it. If set to false, clicking on the link puts the SQL query in the right panel's query box.

The usage of the JavaScript query window is recommended if you have a JavaScript enabled browser. Basic functions are used to exchange quite a few variables, so most 4th generation browsers should be capable to use that feature. It currently is only tested with Internet Explorer 6 and Mozilla 1.x.

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

The query window also has a custom tabbed look to group the features. Using the variable $cfg['QueryWindowDefTab'] you can specify the default tab to be used when opening the query window. It can be set to either 'sql', 'files', 'history' or 'full'.
$cfg['BrowseMIME'] boolean
Enable MIME-transformations.
$cfg['MaxExactCount'] integer
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.
$cfg['MaxExactCountViews'] integer
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'] boolean
Sorts database and table names according to natural order (for example, t1, t2, t10). Currently implemented in the left panel (Light mode) and in Database view, for the table list.
$cfg['InitialSlidersState'] string
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'] 数组
Contains names of configuration options (keys in $cfg array) that users can't set through user preferences. For possible values, refer to libraries/config/user_preferences.forms.php.
$cfg['UserprefsDeveloperTab'] boolean
Activates in the user preferences a tab containing options for developers of phpMyAdmin.
$cfg['TitleTable'] string
$cfg['TitleDatabase'] string
$cfg['TitleServer'] string
$cfg['TitleDefault'] string
Allows you to specify window's title bar. You can use format string expansion.
$cfg['ErrorIconic'] boolean
Uses icons for warnings, errors and informations.
$cfg['MainPageIconic'] boolean
Uses icons on main page in lists and menu tabs.
$cfg['ReplaceHelpImg'] boolean
Shows a help button instead of the "Documentation" message.
$cfg['ThemePath'] string
If theme manager is active, use this as the path of the subdirectory containing all the themes.
$cfg['ThemeManager'] boolean
Enables user-selectable themes. See FAQ 2.7.
$cfg['ThemeDefault'] string
The default theme (a subdirectory under cfg['ThemePath']).
$cfg['ThemePerServer'] boolean
Whether to allow different theme for each server.
$cfg['DefaultQueryTable'] string
$cfg['DefaultQueryDatabase'] string
Default queries that will be displayed in query boxes when user didn't specify any. You can use standard format string expansion.
$cfg['SQP']['fmtType'] string [html|none]
The main use of the new SQL Parser is to pretty-print SQL queries. By default we use HTML to format the query, but you can disable this by setting this variable to 'none'.
$cfg['SQP']['fmtInd'] float
$cfg['SQP']['fmtIndUnit'] string [em|px|pt|ex]
For the pretty-printing of SQL queries, under some cases the part of a query inside a bracket is indented. By changing $cfg['SQP']['fmtInd'] you can change the amount of this indent.
Related in purpose is $cfg['SQP']['fmtIndUnit'] which specifies the units of the indent amount that you specified. This is used via stylesheets.
$cfg['SQP']['fmtColor'] array of string tuples
This array is used to define the colours for each type of element of the pretty-printed SQL queries. The tuple format is
class => [HTML colour code | empty string]
If you specify an empty string for the color of a class, it is ignored in creating the stylesheet. You should not alter the class names, only the colour strings.
Class name key:
  • comment Applies to all comment sub-classes
  • comment_mysql Comments as "#...\n"
  • comment_ansi Comments as "-- ...\n"
  • comment_c Comments as "/*...*/"
  • digit Applies to all digit sub-classes
  • digit_hex Hexadecimal numbers
  • digit_integer Integer numbers
  • digit_float Floating point numbers
  • punct Applies to all punctuation sub-classes
  • punct_bracket_open_round Opening brackets"("
  • punct_bracket_close_round Closing brackets ")"
  • punct_listsep List item Separator ","
  • punct_qualifier Table/Column Qualifier "."
  • punct_queryend End of query marker ";"
  • alpha Applies to all alphabetic classes
  • alpha_columnType Identifiers matching a column type
  • alpha_columnAttrib Identifiers matching a database/table/column attribute
  • alpha_functionName Identifiers matching a MySQL function name
  • alpha_reservedWord Identifiers matching any other reserved word
  • alpha_variable Identifiers matching a SQL variable "@foo"
  • alpha_identifier All other identifiers
  • quote Applies to all quotation mark classes
  • quote_double Double quotes "
  • quote_single Single quotes '
  • quote_backtick Backtick quotes `
$cfg['SQLValidator'] boolean
$cfg['SQLValidator']['use'] boolean
phpMyAdmin now supports use of the Mimer SQL Validator service, as originally published on Slashdot.
For help in setting up your system to use the service, see the FAQ 6.14.
$cfg['SQLValidator']['username'] string
$cfg['SQLValidator']['password'] string
The SOAP service allows you to log in with anonymous and any password, so we use those by default. Instead, if you have an account with them, you can put your login details here, and it will be used in place of the anonymous login.
$cfg['DBG']
DEVELOPERS ONLY!
$cfg['DBG']['sql'] boolean
DEVELOPERS ONLY!
Enable logging queries and execution times to be displayed in the bottom of main page (right frame).
$cfg['ColumnTypes'] array
All possible types of a MySQL column. In most cases you don't need to edit this.
$cfg['AttributeTypes'] array
Possible attributes for columns. In most cases you don't need to edit this.
$cfg['Functions'] array
A list of functions MySQL supports. In most cases you don't need to edit this.
$cfg['RestrictColumnTypes'] array
Mapping of column types to meta types used for preferring displayed functions. In most cases you don't need to edit this.
$cfg['RestrictFunctions'] array
Functions preferred for column meta types as defined in $cfg['RestrictColumnTypes']. In most cases you don't need to edit this.
$cfg['DefaultFunctions'] array
Functions selected by default when inserting/changing row, Functions are defined for meta types from $cfg['RestrictColumnTypes'] and for first_timestamp, which is used for first timestamp column in table.

转换

  1. 介绍
  2. 使用
  3. 文件结构

1. 介绍

要开启转换功能,你必须设置好 column_info 表以及正确的指令。具体设置请见设置一节。

你可以对每个字段的内容使用不同的转换。每个字段中的内容将被预定义的规则所转换。

假设你有一个存有文件名的字段 '文件名' 。正常情况下你只能在 phpMyAdmin 中看到文件名。通过转换你可以将它们转换成一个 HTML 链接,你就能直接在 phpMyAdmin 中点击并在浏览器的新窗口中看到这个文件。你还可以通过转换选项来设置转换所需要的参数。

要想查看所有可用的转换以及它们的选项,你可以在 <www.你的域名.com>/<你的安装目录>/transformation_overview.php 找到。

For a tutorial on how to effectively use transformations, see our Link section on the official phpMyAdmin homepage.

2. 使用

打开到你的 tbl_structure.php 页面 (如: 通过点击一张表的 '结构' 链接) 。点击 "修改" (或修改图标) 后你就能看到在最下方多出三栏。它们分别叫 'MIME 类型'、'浏览器转换' 和 '转换选项' 。

3. 文件结构

所有类型和转换是都通过 'libraries/transformations/' 中的文件定义的。

用文件保存易于定制和添加新的转换。

因为用户不能输入他们的类型,这将保证转换可以正常工作。但这不能避免设置一个转换函数无法处理的类型的问题。

One can, however, use empty mime-types and global transformations which should work for many mimetypes. You can also use transforms on a different mimetype than what they where built for, but pay attention to option usage as well as what the transformation does to your column.

有一个叫 'global.inc.php' 的文件。它可以被任何其它转换函数包含并提供一些基本函数。

5 种可能的文件名:

  1. 一个类型与子类型的转换:

    [类型]_[子类型]__[转换].inc.php

    请注意类型和子类型通过 '_' 分隔,且不包含它们的名字。转换函数/文件名只能使用字符,这样不会导致文件系统和 PHP 函数名转换的问题。

    转换函数则为 'PMA_transform_[类型]_[子类型]__[转换]()' 。

    例:

    text_html__formatted.inc.php
    PMA_transform_text_html__formatted()
  2. 一个类型 (没有子类型) 转换:

    [类型]__[转换].inc.php

    请注意是两个 '_' 符号。 转换函数/文件名只能使用字符,这样不会导致文件系统和 PHP 函数名转换的问题。

    转换函数则为 'PMA_transform_[类型]__[转换]()' 。

    例:

    text__formatted.inc.php
    PMA_transform_text__formatted()
  3. 一个类型与子类型但没有转换函数

    [类型]_[子类型].inc.php

    请注意文件名中没有 '__' 符号。请勿在文件名中使用可能导致文件系统问题的特殊字符。

    文件中不定义转换函数。

    例:

    text_plain.inc.php
    (无函数)
  4. 一个类型 (没有子类型) 但没有转换函数

    [类型].inc.php

    请注意文件名中没有 '_' 符号。请勿在文件名中使用可能导致文件系统问题的特殊字符。

    文件中不定义转换函数。

    例:

    text.inc.php
    (无函数)
  5. 一个不带类型的全局转换函数

    global__[转换].inc.php

    转换函数则为 'PMA_transform_global__[转换]()' 。

    例:

    global__formatted
    PMA_transform_global__formatted()

所以 '_' 通常用来分割类型和子类型,而 '__' 来提供转换函数。

所有文件名中不包含 '__' 的文件将被认为是无效的转换函数而不显示在下拉框中。

参见 libraries/transformations/TEMPLATE 文件来添加你自己的转换函数。参见 libraries/transformations/TEMPLATE_MIMETYPE 来添加一个不带转换函数的类型。

参见 libraries/transformations/template_generator.sh 创建新的转换函数。参见 libraries/transformations/template_generator_mimetype.sh 创建新的类型。

一个转换函数将被传入三个参数:

  1. $buffer - 包含字段中的内容。也是你将要转换的内容。
  2. $options - 以数组形式保存的用户输入的转换选项。
  3. $meta - Contains an object with information about your column. The data is drawn from the output of the mysql_fetch_field() function. This means, all object properties described on the manual page are available in this variable and can be used to transform a column accordingly to unsigned/zerofill/not_null/... properties.
    The $meta->mimetype variable contains the original MIME-type of the column (i.e. 'text/plain', 'image/jpeg' etc.)

Additionally you should also provide additional function to provide information about the transformation to the user. This function should have same name as transformation function just with appended _info suffix. This function accepts no parameters and returns array with information about the transformation. Currently following keys can be used:

info
Long description of the transformation.

FAQ - 常见问题

  1. 服务器
  2. 设置
  3. 已知问题
  4. 互联网服务提供商、多用户安装
  5. 浏览器和客户端操作系统
  6. 使用 phpMyAdmin
  7. phpMyAdmin 项目
  8. 安全
  9. 同步

请到我们的官方网站上查看更多有关 phpMyAdmin 的特性和接口方面的信息。

服务器

1.1 我的服务器不是在处理特定请求时崩溃就是 phpMyAdmin 发送空白页面或者都是乱码的页面,我该怎么办?

config.inc.php 文件中将 $cfg['OBGzip'] 显式地设为 FALSE,同时将 PHP 配置文件中的 zlib.output_compression 显式地设置为 Off

1.2 使用 phpMyAdmin 时,我的 Apache 服务器崩溃了。

请将 Apache 更新到最新版本(如果可能的话,请将 MySQL 也更新到最新版本)。
参考 常见问题 1.1 中有关 PHP 输出缓冲的问题。
如果你的服务器依旧崩溃,请向 Apache 技术支持小组寻求帮助。

1.3 (withdrawn).

1.4 我在 IIS 上使用 phpMyAdmin,网页显示了这样一段错误信息:"CGI 应用程序错误,返回了不完整的HTTP 头 ..."。

You just forgot to read the install.txt file from the PHP distribution. Have a look at the last message in this bug report from the official PHP bug database.

1.5 Using phpMyAdmin on IIS, I'm facing crashes and/or many error messages with the HTTP.

这是一个已知的 PHP ISAPI 过滤器错误:PHP 的 ISAPI 过滤器不是很稳定,建议使用 cookie 认证方式。

1.6 我无法在 PWS 上使用 phpMyAdmin,网页显示一片空白。

这看上去像是 PWS 的 Bug。Filippo Simoncini 找到了一个解决方法,这是目前最好的解决方法:从 libraries/header.inc.php, libraries/header_printview.inc.php, index.php, navigation.phplibraries/common.lib.php 这几个文件中删除 DOCTYPE(共2行)。

1.7 如何使用 Gzip 或 Bzip 压缩 CSV 和其他类型的导出文件? 我设置了相关选项但是似乎不起作用。

These features are based on the gzencode() and bzcompress() PHP functions to be more independent of the platform (Unix/Windows, Safe Mode or not, and so on). So, you must have Zlib/Bzip2 support (--with-zlib and --with-bz2).

1.8 我无法向表中插入文本文件,并且有错误提示说这是因为在安全模式无法进行这样的操作。

您上传的文件被保存在 "上传目录",这个目录可以在 php.ini 中设置(默认设置是 /tmp)。
我们推荐您按照下面的步骤将 Apache 服务器配置在安全模式下运行,这可以保证安全的前提下允许上传文件(本操作仅适用于类 Unix 操作系统):

1.9 (withdrawn).

1.10 我在上传文件的时候遇到了问题,phpMyAdmin 运行在安全服务器上,服务器软件是 Apache,我使用的浏览器是 Internet Explorer。

"Rob M" 在 PHP 帮助论坛给出了解决方法:将下面一行加入到您的 httpd.conf 文件中

SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

该方法似乎可以解决许多使用 Internet Explorer 或 SSL 时遇到的问题。

1.11 我试图从查询窗口上传文件时发生了错误,错误信息是 '开放目录限制'(open_basedir restriction)

从 2.2.4 版本开始,phpMyAdmin 支持服务器上的开放目录限制(open_basedir restrictions)。但是,你需要进行设置才能使用此功能。请创建一个临时目录,并将 $cfg['TempDir'] 设置为临时目录的路径。您上传的文件将会被临时存放在此目录下,SQL 语句执行完毕以后,临时文件就会被删除。

1.12 我忘了 MySQL 的 root 密码,怎么办?

The MySQL manual explains how to reset the permissions.

1.13 (withdrawn).

1.14 (withdrawn).

1.15 I have problems with mysql.user column names.

In previous MySQL versions, the User and Passwordcolumns were named user and password. Please modify your column names to align with current standards.

1.16 我无法上传转储文件,上传时遇到了内存、 HTTP 、超时等方面的错误).

phpMyAdmin 在 2.7.0 重写了导入引擎,并修复了以上问题。如果可能,请升级 phpMyAdmin 到最新版本,并体验 phpMyAdmin 新版给您带来的新特性。

请检查 php.ini 文件中的 upload_max_filesizememory_limit 以及 post_max_size 的设置值。这三个选项都会影响您可以上传的文件大小和 PHP 能够处理的文件大小。如果您没有服务器管理权,请联系服务器管理员(或服务器提供商)检查这几项设置。另外,有用户反应 post_max_size 和 memory_limit 的设置值必须比 upload_max_filesize 的设置值大。

如果您上传的文件很大,或者服务器管理员或提供商不愿意修改以上几个设置,请参考下面的解决方法:

1.17 phpMyAdmin 支持什么版本的 MySQL?

Since phpMyAdmin 3.0.x, only MySQL 5.0.1 and newer are supported. For older MySQL versions, you need to use the latest 2.x branch. phpMyAdmin can connect to your MySQL server using PHP's classic MySQL extension as well as the improved MySQL extension (MySQLi) that is available in PHP 5.0. The latter one should be used unless you have a good reason not to do so.
When compiling PHP, we strongly recommend that you manually link the MySQL extension of your choice to a MySQL client library of at least the same minor version since the one that is bundled with some PHP distributions is rather old and might cause problems (see FAQ 1.17a).

MariaDB is also supported (versions 5.1 and 5.2 were tested).

Since phpMyAdmin 3.5 Drizzle is supported.

1.17a 我无法连接到 MySQL 服务器,它总是提示这个错误:"客户端不支持服务器要求的认证方式,请升级 MySQL 客户端"

You tried to access MySQL with an old MySQL client library. The version of your MySQL client library can be checked in your phpinfo() output. In general, it should have at least the same minor version as your server - as mentioned in FAQ 1.17.

通常在使用 MySQL 4.1 版本时会遇到此问题。MySQL 改变了认证过程中的哈希值,但 PHP 仍使用旧的方法计算此值。要解决此问题,请使用 mysqli 扩展和与 MySQL 服务器相容的客户端库。您可以在 $cfg['Servers'][$i]['extension'] 设置中设置使用 MySQLi。有关更多内容请阅读MySQL 手册

1.18 (withdrawn).

1.19 我无法使用"显示关系"功能。似乎脚本不认识我正在使用的字体。

在此功能中我们使用了 "FPDF" 库,该库还需要其他的一些文件才能使用自定义字体(font faces)。
请参考 FPDF 手册 来生成这些必要的文件。

1.20 我得到了这样的错误信息: "无法载入 MySQL 扩展,请检查 PHP 配置"。

要连接到 MySQL 服务器,PHP 需要使用 MySQL 扩展中相关的 MySQL 函数。这个扩展应该需要编译到 PHP 中,或者以动态方式加载。如果是以动态方式加载,动态库的文件有可能是 mysql.sophp_mysql.dll。phpMyAdmin 试图加载动态库文件,但加载失败了。

通常情况下,安装 "PHP-MySQL" 或者其他类似的软件包即可解决此问题。

1.21 我在 Unix 下以 CGI 方式运行 PHP,但却无法使用 cookie 认证方式来登录。

php.ini 文件中将 mysql.max_links 设为比1大的值。

1.22 我找不到 "选择文件" 的按钮,那该怎么上传文件?

通常这是因为您没有在 php.ini 中将 file_uploads 选项设置为 "on"。

1.23 I'm running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!

这是因为 Win32 版本的 MySQL 默认将 lower_case_table_names 设置为1(ON)。您可以将此设置显式地设为0(也就是OFF)来解决这个问题:
打开 my.ini 文件,这个文件应该在您的 Windows 目录下,在“[mysqld]”后一行增加:

set-variable = lower_case_table_names=0

然后,重新启动 MySQL。您也可以使用如下的查询语句来查询此设置值:

SHOW VARIABLES LIKE 'lower_case_table_names';

1.24 (withdrawn).

1.25 我在 Windows XP 上使用 Apache,并加载了mod_gzip-1.3.26.1a。在运行 SQL 查询时出现了类似变量未定义的错误。

Jose Fandos 给出的解决方法:在 httpd.conf 中增加下面两行:

# mod_gzip_item_include file \.php$
# mod_gzip_item_include mime "application/x-httpd-php.*"

该 Windows 版本的 Apache mod_gzip 模块在处理 PHP 脚本时有些小问题。修改 httpd.conf 后,请重新启动 Apache。

1.26 我将 phpMyAdmin 安装在了 IIS 根目录下,在我打开 phpMyAdmin 页面时,却出现了这样的错误:"No input file specified"

这是一个权限问题。右键单击 phpMyAdmin 目录,选择 属性-->-->安全-->增加,然后选择在用户列表中选择 IUSR_machine 用户,赋予其权限,即可解决此问题。

1.27 当我打开一个很大的页面时,页面显示空白(如 db_structure.php 页面中显示了很多表的时候)

这是一个 PHP 错误,该错误会在打开 GZIP 输出的时候发生。如果您在 config.inc.php 中修改 $cfg['OBGzip'] = false 选项来关闭这个功能,就能解决此问题。这个错误将会在 PHP 5.0.0 版本中修复。

1.28 我的 MySQL 服务器偶尔会返回 'Errorcode: 13' 这样的错误信息,这是神么意思?

这个错误可能是因为 lower_case_table_names 被设为了1,而数据库中存在表名为大写的表,这是 MySQL 的一个错误。要解决此问题,请先显示地将 lower_case_table_names 设为 false,然后将所有表名改为小写,最后再重新将 lower_case_table_names 设为 true。MySQL 3.23.56 / 4.0.11-gamma 版本已经修复了这个问题。

1.29 When I create a table or modify a column, I get an error and the columns are duplicated.

这可能是因为没有正确配置 Apache 而导致 PHP 无法正确解释 .php 文件。

该问题的产生,可能是因为在 Apache 的配置文件中显式地指定了两组互相冲突的设置:

SetOutputFilter PHP
SetInputFilter PHP

AddType application/x-httpd-php .php

上面两组设置,有一组位于 /etc/httpd/conf/httpd.conf 中,另一组位于 /etc/httpd/conf/addon-modules/php.conf 中。
推荐的设置是使用 AddType,所以,我们可以注释掉另外一组设置,就象这样:

#SetOutputFilter PHP
#SetInputFilter PHP

1.30 I get the error "navigation.php: Missing hash".

产正这个问题的原因是您的服务器上运行着 Turck MMCache,升级 MMCache 到 2.3.21 版本就可解决此问题。

1.31 phpMyAdmin 支持 PHP5 吗?

当然支持。

phpMyAdmin 3.0 及之后的版本只能在 PHP 5.2 或更新的版本上运行。对于旧版本的 PHP,请使用 phpMyAdmin 2.9 版本分支,这个分支版本目前还在维护中。

1.32 我能在 IIS 服务器上使用 HTTP 认证吗?

可以。我们在 IIS 5.1 上以 ISAPI 方式加载 PHP 4.3.9,使用 phpMyAdmin 2.6.1 版本进行测试,结果可以正常使用 phpMyAdmin。

  1. 请在 php.ini 文件中将 cgi.rfc2616_headers 设为0。
  2. 打开站点属性——>目录安全性——>匿名访问对话框,选中“启用匿名访问“,并去掉“基本身份验证“”集成 Windows 身份验证“和“Windows 域服务器的摘要试身份验证“以及其他的复选框。
  3. 自定义错误选项卡中,选中401;1401;5条目,然后点击设为默认按钮。

1.33 (withdrawn).

1.34 我能直接输入网址来显示数据库和表吗?

当然可以。您可以直接输入类似 http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script 的 URL。其中,server 域指定了您在 config.inc.php 中设置的服务器编号。table 和 script 域是可选的。如果您想使用类似 http://server/phpMyAdmin/database[/table][/script] 这样的 URL,还需要进行一些额外的设置。下面给出在 Apache 上进行设置的方法: 首先请确定您已经在全局范围内启用了 Options FollowSymLinksAllowOverride FileInfo 功能,然后,在 phpMyAdmin 的目录配置下启用这两个功能。接着,在 phpMyAdmin 根目录下创建 .htaccess 文件,并将如下内容写入文件中:

RewriteEngine On
RewriteBase /path_to_phpMyAdmin
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]

1.35 我将 PHP 配置为在 Apache 上以 CGI 方式运行。在这种情况下我能否使用 HTTP 认证?

可以,但您需要设置以下重写规则,以便将登录参数传送给 CGI

RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

1.36 网页显示 "500 Internal Server Error",怎么办?

导致这种情况的原因有很多种,请查看您的服务器错误日志,其中可能包含了有关的错误信息。

1.37 加密密码功能不起作用。我使用 cookie 认证方式,phpMyAdmin 运行在服务器集群上。

如果您的集群中存在不同体系结构的系统,就会导致 PHP 无法使用 pack/unpack 函数进行正确的加解密操作。解决此问题的方法是使用 mcrypt 扩展。

1.38 我能在启用了 Suhosin 的服务器上使用 phpMyAdmin 吗?

Yes but the default configuration values of Suhosin are known to cause problems with some operations, for example editing a table with many columns and no primary key or with textual primary key.

Suhosin configuration might lead to malfunction in some cases and it can not be fully avoided as phpMyAdmin is kind of application which needs to transfer big amounts of columns in single HTTP request, what is something what Suhosin tries to prevent. Generally all suhosin.request.*, suhosin.post.* and suhosin.get.* directives can have negative effect on phpMyAdmin usability. You can always find in your error logs which limit did cause dropping of variable, so you can diagnose the problem and adjust matching configuration variable.

The default values for most Suhosin configuration options will work in most scenarios, however you might want to adjust at least following parameters:

You can also disable the warning using the SuhosinDisableWarning directive.

1.39 在使用 http 时我能正常登录,但是在切换到 https 方式后却不能登录了,这是怎么回事?

请确认您在 Apache 的配置文件中启用了 SSLOptions 和 StdEnvVars。具体请参考 http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions

1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work.

要在此方式下使用 cookie 认证,请确保将 Apache 设置为重写 set-cookie 头。
Apache 2.2 中给出了一个例子:

ProxyPass /mirror/foo/ http://backend.example.com/
ProxyPassReverse /mirror/foo/ http://backend.example.com/
ProxyPassReverseCookieDomain backend.example.com public.example.com 
ProxyPassReverseCookiePath / /mirror/foo/ 

注意:如果您的 URL 中带有 ~ 字符,请在 ProxyPassReverse 设置中将其转义为 %7E,就像下面那样:

ProxyPass /mirror/foo/ http://backend.example.com/~user/phpmyadmin
ProxyPassReverse /mirror/foo/
http://backend.example.com/%7Euser/phpmyadmin
ProxyPassReverseCookiePath /%7Euser/phpmyadmin /mirror/foo

更多信息请参考 http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

1.41 When I view a database and ask to see its privileges, I get an error about an unknown column.

MySQL 服务器的权限表没有更新,请运行 mysql_upgrade 命令来进行更新。

设置

2.1 页面显示 "Warning: Cannot add header information - headers already sent by ...",怎么办?

请检查 config.inc.php 文件,确保在 <?php 之前和 ?> 标签之后没有任何字符(包括空格、制表符以及空行等)。在 IIS 上使用 zipped 功能的用户同样向我们反馈了类似问题,在 libraries/Config.class.php 文件末尾有一个行尾符(ASCII 码为 0A),删除此字符即可解决问题。

2.2 phpMyAdmiin 无法连接到 MySQL 服务器,这是怎么回事?

这可能是因为您的 PHP 配置有误,或者您使用的登录名和密码错误。请写一个脚本,使用 mysql_connect 来尝试是否能连接到 MySQL 服务器,如果不能,就说明您可能没有将 MySQL 编译到 PHP 中,或者没有加载 MySQL 库。

2.3 网页显示 "Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) ..." 这样的错误,怎么办?

Harald Legner 在邮件列表中为 RedHat 用户给出了一个解决方法:

在我的 RadHat 服务器上,MySQL 的 socket 是 /var/lib/mysql/mysql.sock,你应该能在 php.ini 文件中找到这样一行:

mysql.default_socket = /tmp/mysql.sock

将其修改为

mysql.default_socket = /var/lib/mysql/mysql.sock

之后重新启动 Apache,即可解决问题。

Brad Ummer 给出了另一种解决方案:

Have also a look at the corresponding section of the MySQL documentation.

2.4 我运行 phpMyAdmin 的时候,浏览器什么都没有显示,怎么办?

请在 phpMyAdmin 的配置文件中将 $cfg['OBGZip'] 显式地设为 FALSE,也许能解决此问题。
Also have a look at your PHP version number: if it contains "b" or "alpha" it means you're running a testing version of PHP. That's not a so good idea, please upgrade to a plain revision.

2.5 Each time I want to insert or change a row or drop a database or a table, an error 404 (page not found) is displayed or, with HTTP or cookie authentication, I'm asked to log in again. What's wrong?

请在 phpMyAdmin 的配置文件中检查您是否显式地设定了 $cfg['PmaAbsoluteUri']

2.6 我试图连接到 MySQL 服务器时得到这样的错误:"Access denied for user: 'root@localhost' (Using password: YES)"。我对 MySQL 服务器端口进行了端口映射,将localhost 的端口转发到 MySQL 服务器端口上。

当您在自己的机器上(localhost)使用端口映射访问另一台机器上的 MySQL 时,MySQL 解析 localhost 主机名时将得到错误的结果。
Erik Wasser explains: The solution is: if your host is "localhost" MySQL (the command line tool mysql as well) always tries to use the socket connection for speeding up things. And that doesn't work in this configuration with port forwarding.
如果你使用 127.0.0.1 作为主机名,并使用将 MySQL 设置为使用 TCP 链接,就可以正常登录了。

2.7 如何创建和使用主题?

有关主题的设置项是:$cfg['ThemePath'], $cfg['ThemeManager'] 以及 $cfg['ThemeDefault']

请不要修改 $cfg['ThemePath'] 选项设置的目录下的文件结构,更不要删除这个目录。这个目录是 phpMyAdmin 的系统主题,如果一些主题缺少某些文件,phpMyAdmin 就会使用系统主题的文件替代之。

如果设置了 $cfg['ThemeManager'],您就可以在 phpMyAdmin 主页面中选择喜欢的主题。您使用的主题名字将会保存在 cookie 中。

要创建一个主题,请按照下面的方法进行操作:

在主题目录下有一个 info.inc.php 文件,其中包含了主题全名和主题版本号。主题版本号由您自行设定,不需要符合 phpMyAdmin 的版本号,只需要保证版本号是纯数字就行。拥有相同主版本号(generation number)的主题应该向下兼容。子版本号为2的主题应该能在使用子版本1主题的 phpMyAdmin 上正常显示。主版本号不相同的主题无须相互兼容。

如果您没有自己主题的图标和按钮,请删除您的主题目录下的 img 目录。phpMyAdmin 将使用默认的图标和按钮(位于 original 目录下的系统主题)。

2.8 我遇到了一个错误,错误提示 "缺少参数" 怎么办?

请先检查以下几点:

2.9 怎样设置才能显示上传进度条

要使用此功能,请在服务器上安装 APC 扩展或 uploadprogress,并启用 JSON 扩展。

如果使用 APC,请在 php.ini 中将 apc.rfc1867 设为 on

Known limitations

3.1 When using HTTP authentication, a user who logged out can not log in again in with the same nick.

这是 phpMyAdmin 的认证机制引起的问题。要解决此问题,请关闭所有已打开的 Windows 文件夹,然后重新登录 phpMyAdmin。

3.2 转储一个很大的表时,遇到了“超出内存限制“或“运行超时“错误。

压缩转储在内存中进行,而 PHP 对内存的使用有限制。从 2.5.4 版本开始,可以使用 Gzip/BZip2 导出来解决此问题。启用 $cfg['CompressOnFly'] 选项(默认已启用)。此方法不支持 Zip 导出,要进行 Zip 导出,需要使用其他的方法。

3.3 重命名 InnoDB 表名或其中的字段名时,外间关系会丢失。

这是一个 InnoDB 引擎的错误,请参考:http://bugs.mysql.com/bug.php?id=21704

3.4 我无法导入用 MySQL 服务器工具 mysqldump 生成的转储文件。

The problem is that older versions of mysqldump created invalid comments like this:

-- MySQL dump 8.22
--
-- Host: localhost Database: database
---------------------------------------------------------
-- Server version 3.23.54

错误的注释是那行由短横线组成的水平线,正确的注释应该是两个短横线后面跟一个空格。所以,要解决此问题,请在水平线的前两个短横线后加上一个空格,或直接在水平线的前面加上一个#符号,就像下面这样:
-- -------------------------------------------------------
或者
#---------------------------------------------------------

3.5 When using nested folders there are some multiple hierarchies displayed in a wrong manner?! ($cfg['LeftFrameTableSeparator'])

Please note that you should not use the separating string multiple times without any characters between them, or at the beginning/end of your table name. If you have to, think about using another TableSeparator or disabling that feature

3.6 What is currently not supported in phpMyAdmin about InnoDB?

In Relation view, being able to choose a table in another database, or having more than one index column in the foreign key.

In Query-by-example (Query), automatic generation of the query LEFT JOIN from the foreign table.

3.7 I have table with many (100+) columns and when I try to browse table I get series of errors like "Warning: unable to parse url". How can this be fixed?

Your table neither have a primary key nor an unique one, so we must use a long expression to identify this row. This causes problems to parse_url function. The workaround is to create a primary or unique key.

3.8 I cannot use (clickable) HTML-forms in columns where I put a MIME-Transformation onto!

Due to a surrounding form-container (for multi-row delete checkboxes), no nested forms can be put inside the table where phpMyAdmin displays the results. You can, however, use any form inside of a table if keep the parent form-container with the target to tbl_row_delete.php and just put your own input-elements inside. If you use a custom submit input field, the form will submit itself to the displaying page again, where you can validate the $HTTP_POST_VARS in a transformation. For a tutorial on how to effectively use transformations, see our Link section on the official phpMyAdmin-homepage.

3.9 I get error messages when using "--sql_mode=ANSI" for the MySQL server

When MySQL is running in ANSI-compatibility mode, there are some major differences in how SQL is structured (see http://dev.mysql.com/doc/mysql/en/ansi-mode.html). Most important of all, the quote-character (") is interpreted as an identifier quote character and not as a string quote character, which makes many internal phpMyAdmin operations into invalid SQL statements. There is no workaround to this behaviour. News to this item will be posted in Bug report #816858

3.10 Homonyms and no primary key: When the results of a SELECT display more that one column with the same value (for example SELECT lastname from employees where firstname like 'A%' and two "Smith" values are displayed), if I click Edit I cannot be sure that I am editing the intended row.

Please make sure that your table has a primary key, so that phpMyAdmin can use it for the Edit and Delete links.

3.11 The number of rows for InnoDB tables is not correct.

phpMyAdmin uses a quick method to get the row count, and this method only returns an approximate count in the case of InnoDB tables. See $cfg['MaxExactCount'] for a way to modify those results, but this could have a serious impact on performance.

3.12 (withdrawn).

3.13 I get an error when entering USE followed by a db name containing an hyphen.

The tests I have made with MySQL 5.1.49 shows that the API does not accept this syntax for the USE command.

3.14 I am not able to browse a table when I don't have the right to SELECT one of the columns.

This has been a known limitation of phpMyAdmin since the beginning and it's not likely to be solved in the future.

3.15 (withdrawn).

3.16 (withdrawn).

3.17 (withdrawn).

3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table.

There is no reliable way to differentiate tables in CSV format. For the time being, you will have to break apart CSV files containing multiple tables.

3.19 When I import a file and have phpMyAdmin determine the appropriate data structure it only uses int, decimal, and varchar types.

Currently, the import type-detection system can only assign these MySQL types to columns. In future, more will likely be added but for the time being you will have to edit the structure to your liking post-import.

Also, you should note the fact that phpMyAdmin will use the size of the largest item in any given column as the column size for the appropriate type. If you know you will be adding larger items to that column then you should manually adjust the column sizes accordingly. This is done for the sake of efficiency.

ISPs, multi-user installations

4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer.

Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your users. The development of this feature was kindly sponsored by NetCologne GmbH. This requires a properly setup MySQL user management and phpMyAdmin HTTP or cookie authentication. See the install section on "Using HTTP authentication".

4.2 What's the preferred way of making phpMyAdmin secure against evil access.

This depends on your system.
If you're running a server which cannot be accessed by other people, it's sufficient to use the directory protection bundled with your webserver (with Apache you can use .htaccess files, for example).
If other people have telnet access to your server, you should use phpMyAdmin's HTTP or cookie authentication features.

Suggestions:

4.3 I get errors about not being able to include a file in /lang or in /libraries.

Check php.ini, or ask your sysadmin to check it. The include_path must contain "." somewhere in it, and open_basedir, if used, must contain "." and "./lang" to allow normal operation of phpMyAdmin.

4.4 phpMyAdmin always gives "Access denied" when using HTTP authentication.

This could happen for several reasons:

4.5 Is it possible to let users create their own databases?

Starting with 2.2.5, in the user management page, you can enter a wildcard database name for a user (for example "joe%"), and put the privileges you want. For example, adding SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER would let a user create/manage his/her database(s).

4.6 How can I use the Host-based authentication additions?

If you have existing rules from an old .htaccess file, you can take them and add a username between the 'deny'/'allow' and 'from' strings. Using the username wildcard of '%' would be a major benefit here if your installation is suited to using it. Then you can just add those updated lines into the $cfg['Servers'][$i]['AllowDeny']['rules'] array.

If you want a pre-made sample, you can try this fragment. It stops the 'root' user from logging in from any networks other than the private network IP blocks.

//block root from logging in except from the private networks
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
    'deny root from all',
    'allow root from localhost',
    'allow root from 10.0.0.0/8',
    'allow root from 192.168.0.0/16',
    'allow root from 172.16.0.0/12',
    );

4.7 Authentication window is displayed more than once, why?

This happens if you are using a URL to start phpMyAdmin which is different than the one set in your $cfg['PmaAbsoluteUri']. For example, a missing "www", or entering with an IP address while a domain name is defined in the config file.

4.8 Which parameters can I use in the URL that starts phpMyAdmin?

When starting phpMyAdmin, you can use the db, pma_username, pma_password and server parameters. This last one can contain either the numeric host index (from $i of the configuration file) or one of the host names present in the configuration file. Using pma_username and pma_password has been tested along with the usage of 'cookie' auth_type.

Browsers or client OS

5.1 I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns.

We could reproduce this problem only under Win98/98SE. Testing under WinNT4 or Win2K, we could easily create more than 60 columns.
A workaround is to create a smaller number of columns, then come back to your table properties and add the other columns.

5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields.

This is not a phpMyAdmin problem but a Xitami known bug: you'll face it with each script/website that use forms.
Upgrade or downgrade your Xitami server.

5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2).

With Konqueror 2.1.1: plain dumps, zip and GZip dumps work ok, except that the proposed file name for the dump is always 'tbl_dump.php'. Bzip2 dumps don't seem to work.
With Konqueror 2.2.1: plain dumps work; zip dumps are placed into the user's temporary directory, so they must be moved before closing Konqueror, or else they disappear. GZip dumps give an error message.
Testing needs to be done for Konqueror 2.2.2.

5.4 I can't use the cookie authentication mode because Internet Explorer never stores the cookies.

MS Internet Explorer seems to be really buggy about cookies, at least till version 6.

5.5 In Internet Explorer 5.0, I get JavaScript errors when browsing my rows.

Upgrade to at least Internet Explorer 5.5 SP2.

5.6 In Internet Explorer 5.0, 5.5 or 6.0, I get an error (like "Page not found") when trying to modify a row in a table with many columns, or with a text column

Your table neither have a primary key nor an unique one, so we must use a long URL to identify this row. There is a limit on the length of the URL in those browsers, and this not happen in Netscape, for example. The workaround is to create a primary or unique key, or use another browser.

5.7 I refresh (reload) my browser, and come back to the welcome page.

Some browsers support right-clicking into the frame you want to refresh, just do this in the right frame.

5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query box.

Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future Mozilla versions.

5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a whitespace in the SQL-Query edit area: the page scrolls down.

This is a Mozilla bug (see bug #26882 at BugZilla).

5.10 With Netscape 4.75 I get empty rows between each row of data in a CSV exported file.

This is a known Netscape 4.75 bug: it adds some line feeds when exporting data in octet-stream mode. Since we can't detect the specific Netscape version, we cannot workaround this bug.

5.11 Extended-ASCII characters like German umlauts are displayed wrong.

Please ensure that you have set your browser's character set to the one of the language file you have selected on phpMyAdmin's start page. Alternatively, you can try the auto detection mode that is supported by the recent versions of the most browsers.

5.12 Mac OS X: Safari browser changes special characters to "?".

This issue has been reported by a OS X user, who adds that Chimera, Netscape and Mozilla do not have this problem.

5.13 With Internet Explorer 5.5 or 6, and HTTP authentication type, I cannot manage two servers: I log in to the first one, then the other one, but if I switch back to the first, I have to log in on each operation.

This is a bug in Internet Explorer, other browsers do not behave this way.

5.14 Using Opera6, I can manage to get to the authentication, but nothing happens after that, only a blank screen.

Please upgrade to Opera7 at least.

5.15 I have display problems with Safari.

Please upgrade to at least version 1.2.3.

5.16 With Internet Explorer, I get "Access is denied" Javascript errors. Or I cannot make phpMyAdmin work under Windows.

Please check the following points:

5.17 With Firefox, I cannot delete rows of data or drop a database.

Many users have confirmed that the Tabbrowser Extensions plugin they installed in their Firefox is causing the problem.

5.18 With Konqueror 4.2.x an invalid LIMIT clause is generated when I browse a table.

This happens only when both of these conditions are met: using the http authentication mode and register_globals being set to On on the server. It seems to be a browser-specific problem; meanwhile use the cookie authentication mode.

5.19 I get JavaScript errors in my browser.

Issues have been reported with some combinations of browser extensions. To troubleshoot, disable all extensions then clear your browser cache to see if the problem goes away.

使用 phpMyAdmin

6.1 我插入不了数据到表中 / 我创建不了数据表 - MySQL 提示 SQL 错误。

仔细检查 SQL 错误。这个问题通常是因为指定了错误的字段类型。
常见错误有:

同时,请参考 MySQL 手册中语法一章确定你的语法都正确。

6.2 建表时,我给两个字段设置了索引,但 phpMyAdmin 却创建了一个包含这两个字段的索引。

这是一种创建多字段索引的方法。如果你需要两个索引,在建表时先设置一个,保存,然后显示数据表属性并点击索引链接来创建另一个索引。

6.3 怎样向我的表中插入一个空 (null) 值?

自 2.2.3 版起,每个字段都有一个复选框来设置字段是否为空。 2.2.3 之前,你只能输入 "null",不包括引号来作为字段的值。自 2.5.5 版起,你可以使用复选框来获得一个真正的空 (NULL) 值,如果你输入 "NULL" 将表示文字 NULL,而不是空 (NULL) 值 (对 PHP4 同样有效)。

6.4 怎样备份我的数据库或数据表?

在左侧框架中点击数据库或表名,将会显示它们的属性。 然后在菜单上点击 "导出",你可以转储结构和/或数据。该功能将生成标准 SQL 语句以便重新创建你的数据库/表。

若选择 "保存为文件",phpMyAdmin 即可将转储结果直接提供下载。取决于 PHP 的配置,你还能看见压缩选项。同时请参见 $cfg['ExecTimeLimit'] 配置变量。

要获得更多关于该主题的帮助,请在本文档中查找 "转储" 。

6.5 怎样通过转储恢复 (上传) 我的数据库或表?怎样运行一个 ".sql" 文件?

在左侧框架中点击数据库或表名,将会显示它们的属性。在右手边框架中的标签列表中选择 "导入" (或 "SQL" 如果你的 phpMyAdmin 版本低于 2.7.0)。在 "文本文件的位置" 中输入你的转储文件名,或使用浏览按钮。然后点击执行。

2.7.0 版的导入功能已经重写了,建议尽可能升级以使用新功能。

要获得更多关于该主题的帮助,请在本文档中查找 "上传" 。

6.6 怎样在依例查询 (Query-by-example) 中使用关系表?

下面用数据库 mydb 中的数据表 persons、towns 和 countries 来举例。如果你没有 pma_relation 表,请先根据设置一节中的说明创建。然后创建示范表:

CREATE TABLE REL_countries (
    country_code char(1) NOT NULL default '',
    description varchar(10) NOT NULL default '',
    PRIMARY KEY (country_code)
) TYPE=MyISAM;

INSERT INTO REL_countries VALUES ('C', 'Canada');

CREATE TABLE REL_persons (
    id tinyint(4) NOT NULL auto_increment,
    person_name varchar(32) NOT NULL default '',
    town_code varchar(5) default '0',
    country_code char(1) NOT NULL default '',
    PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO REL_persons VALUES (11, 'Marc', 'S', '');
INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C');

CREATE TABLE REL_towns (
    town_code varchar(5) NOT NULL default '0',
    description varchar(30) NOT NULL default '',
    PRIMARY KEY (town_code)
) TYPE=MyISAM;

INSERT INTO REL_towns VALUES ('S', 'Sherbrooke');
INSERT INTO REL_towns VALUES ('M', 'Montréal');

设置对应连接并显示信息:

测试步骤如下:

6.7 怎样使用 "显示字段" 功能?

Starting from the previous example, create the pma_table_info as explained in the configuration section, then browse your persons table, and move the mouse over a town code or country code.

See also FAQ 6.21 for an additional feature that "display column" enables: drop-down list of possible values.

6.8 怎样给我的数据库生成一份 PDF 大纲?

首先要设置好 "relation"、"table_coords" 和 "pdf_pages" 变量。

然后你要确定你的大纲布局。每张表分别放在第几页。

6.9 phpMyAdmin is changing the type of one of my columns!

No, it's MySQL that is doing silent column type changing.

6.10 When creating a privilege, what happens with underscores in the database name?

If you do not put a backslash before the underscore, this is a wildcard grant, and the underscore means "any character". So, if the database name is "john_db", the user would get rights to john1db, john2db ...

If you put a backslash before the underscore, it means that the database name will have a real underscore.

6.11 What is the curious symbol ø in the statistics pages?

It means "average".

6.12 我想了解一些导出选项。

结构:

数据:

6.13 我想创建一个名字里包含点的数据库。

这是个馊主意,因为在 MySQL 的语法中 "数据库.表" 是一个常见的引用指定数据库中表的用法。更糟糕的是,MySQL 通常会允许你创建这样一个数据库,但是你无法使用它,甚至无法删除它。

6.14 怎样设置 SQL 校验器?

要想使用 SQL 校验器,你需要 PHP 的 XMLPCREPEAR 扩展支持。 此外还需要 SOAP 支持,PHP 扩展或 PEAR SOAP 模块均可。

要安装 PEAR SOAP 模块,请运行 "pear install Net_Socket Net_URL HTTP_Request Mail_Mime Net_DIME SOAP" 以获取依赖的 PEAR 模块。

请注意,校验器会匿名记录你所有的 SQL 查询语句 (数据库/表/字段名、字符串、数字将被替换为通用值) 。Mimer SQL 校验器,版权所有 © 2001 Upright Database Technology. 我们使用它的免费 SOAP 服务。

6.15 我想添加一个 BLOB 字段并索引它,但是 MySQL 说 "BLOB column '...' used in key specification without a key length" 。

正确的方法是,首先添加不带索引的字段,然后显示表结构并使用 "创建索引" 对话框。在这个页面中,你就可以选择 BLOB 字段,并设置索引的大小,这是在 BLOB 字段上建立索引的条件。

6.16 How can I simply move in page with plenty editing fields?

You can use Ctrl+arrows (Option+Arrows in Safari) for moving on most pages with many editing fields (table structure changes, row editing, etc.). You can also have a look at the directive $cfg['DefaultPropDisplay'] ('vertical') and see if this eases up editing for you.

6.17 Transformations: I can't enter my own mimetype! WTF is this feature then useful for?

Slow down :). Defining mimetypes is of no use, if you can't put transformations on them. Otherwise you could just put a comment on the column. Because entering your own mimetype will cause serious syntax checking issues and validation, this introduces a high-risk false-user-input situation. Instead you have to initialize mimetypes using functions or empty mimetype definitions.
Plus, you have a whole overview of available mimetypes. Who knows all those mimetypes by heart so he/she can enter it at will?

6.18 书签: 怎么保存书签?为什么我在查询框下找不到书签?变量有什么用?

你可以在显示查询结果的页面将你执行的任何查询保存为书签。通过按下页面底部写有 '将此查询加为书签' 字样的按钮。
As soon as you have stored a bookmark, it is related to the database you run the query on. You can now access a bookmark dropdown on each page, the query box appears on for that database.

Since phpMyAdmin 2.5.0 you are also able to store variables for the bookmarks. Just use the string /*[VARIABLE]*/ anywhere in your query. Everything which is put into the value input box on the query box page will replace the string "/*[VARIABLE]*/" in your stored query. Just be aware of that you HAVE to create a valid query, otherwise your query won't be even able to be stored in the database.
Also remember, that everything else inside the /*[VARIABLE]*/ string for your query will remain the way it is, but will be stripped of the /**/ chars. So you can use:

/*, [VARIABLE] AS myname */

which will be expanded to

, VARIABLE as myname

in your query, where VARIABLE is the string you entered in the input box. If an empty string is provided, no replacements are made.

现在举一个更复杂的例子。假如你保存了这个查询:

SELECT 名字, 地址 FROM 地址表 WHERE 1 /* AND 名字 LIKE '%[变量]%' */

假如你输入了 "张三" 作为变量,完整的查询将会是:

SELECT 名字, 地址 FROM 地址表 WHERE 1 AND 名字 LIKE '%张三%'

你可以在一个查询中多次使用 /*[变量]*/ (这表示使用同一个变量) 。
NOTE THE ABSENCE OF SPACES inside the "/**/" construct. Any spaces inserted there will be later also inserted as spaces in your query and may lead to unexpected results especially when using the variable expansion inside of a "LIKE ''" expression.
Your initial query which is going to be stored as a bookmark has to yield at least one result row so you can store the bookmark. You may have that to work around using well positioned "/**/" comments.

6.19 怎样创建一份包含导出表的简单的 LATEX 文档?

建立包含表的 LATEX 文档很简单,最简单的例子如下所示 (假设你已将表导出到文件 table.tex 中):

\documentclass{article} % or any class you want
\usepackage{longtable}  % for displaying table
\begin{document}        % start of document
\include{table}         % including exported table
\end{document}          % end of document

6.20 我看到好多不属于我的数据库,而且我也无法访问它们。

这是因为你至少有下列全局权限之一: CREATE TEMPORARY TABLES 、 SHOW DATABASES 和 LOCK TABLES。这些权限将允许用户看见所有的数据库名。 参见这个缺陷报告

所以如果你的用户不需要这些权限,你可以撤销这些权限以使他们的数据库列表短些。

6.21 怎样才能在编辑/插入模式中看见某个字段基于外键表的可能的值的列表?

你需要正确设置两张表之间的关系,同时还要在外键表设置 "显示字段" 。参见 FAQ 6.6 中的例子。这时,如果外键表中有不超过 100 个值,就会出现一个下拉框。 你将会看到两个列表,第一个列表包含键和显示字段,第二个列表包含显示字段和键。这么做的目的是为了可以通过按下键或显示字段的首字母来定位。

若超过了 100 个值,将会使用新窗口,请浏览外键并选择。要修改默认 100 个值的限制,参见 $cfg['ForeignKeyMaxLimit']

6.22 书签: 我能在进入一张表的浏览模式时自动执行一个书签吗?

Yes. If a bookmark has the same label as a table name and it's not a public bookmark, it will be executed.

6.23 Export: I heard phpMyAdmin can export Microsoft Excel files?

You can use CSV for Microsoft Excel, which works out of the box.
Since phpMyAdmin 3.4.5 support for direct export to Microsoft Excel version 97 and newer was dropped.

6.24 现在 phpMyAdmin 支持了 MySQL 4.1.x 的字段注释,我原来在 phpMyAdmin 高级功能中所保存的字段注释会怎样?

它们将在你进入该表的结构页面时自动并入。

6.25 BLOB 流在 phpMyAdmin 中是怎样工作的?

要获得关于 MySQL BLOB 流的信息,请访问 blobstreaming.org 。你需要下列组件:

以下是详细的配置和操作说明:

  1. config.inc.php 中的主机必须是一个 FQDN (完全合格域名) 而不是 "localhost" 。
  2. 确保你的目标表正在使用 PBXT 存储引擎并且有一个 LONGBLOB 类型的字段 (如果你想去除 BLOB 关系则必须可为空) 。
  3. 当上传或更新一条记录时,勾选 "上传到 BLOB 库" 复选框即可;否则,文件数据将被直接保存在你的 LONGBLOB 字段而不是 BLOB 库中。
  4. 最后在浏览数据表时,你会看到一个指向数据的链接,例如 "查看图像" 。若在上传时保存了正确的 MIME 类型,它将会被发送到你的浏览器。

6.26 我可以选择一段连续的行吗?

先点击要选择的第一行,按住 Shift 键不放并点击最后一行。这在任何有行的地方都有效,例如浏览模式和结构页面。

6.27 我可以使用哪些格式字符串?

在所有 phpMyAdmin 接受格式字符串的地方,你都可以使用扩展 @变量@strftime 格式字符串。扩展变量基于当前环境 (例如,在你没有选中任何数据表时,你就无法获取表名) ,可以使用下列变量:

@HTTP_HOST@
运行 phpMyAdmin 的 HTTP 主机
@SERVER@
MySQL 服务器名
@VERBOSE@
服务器设置中定义的详细的 MySQL 服务器名
@VSERVER@
如果设置了详细的 MySQL 服务器名则使用,否则使用常规的服务器名
@DATABASE@
当前打开的数据库
@TABLE@
当前打开的数据表
@COLUMNS@
Columns of the currently opened table
@PHPMYADMIN@
带版本号的 phpMyAdmin 字样

6.28 How can I easily edit relational schema for export?

By clicking on the button 'toggle scratchboard' on the page where you edit x/y coordinates of those elements you can activate a scratchboard where all your elements are placed. By clicking on an element, you can move them around in the pre-defined area and the x/y coordinates will get updated dynamically. Likewise, when entering a new position directly into the input field, the new position in the scratchboard changes after your cursor leaves the input field.

You have to click on the 'OK'-button below the tables to save the new positions. If you want to place a new element, first add it to the table of elements and then you can drag the new element around.

By changing the paper size and the orientation you can change the size of the scratchboard as well. You can do so by just changing the dropdown field below, and the scratchboard will resize automatically, without interfering with the current placement of the elements.

If ever an element gets out of range you can either enlarge the paper size or click on the 'reset' button to place all elements below each other.

6.29 为什么我的查询结果表不能显示为图表?

不是所有的表都能显示为图表。只有包含一个、两个或者三个字段的表才能通过图表表现出来。并且它还必须具有能令图表脚本理解的特定格式。当前所支持的格式可以在维基 (wiki) 中找到。

6.30 Import: How can I import ESRI Shapefiles

An ESRI Shapefile is actually a set of several files, where .shp file contains geometry data and .dbf file contains data related to those geometry data. To read data from .dbf file you need to have PHP compiled with the dBase extension (--enable-dbase). Otherwise only geometry data will be imported.

To upload these set of files you can use either of the following methods:

6.31 How do I create a relation in designer?

要选择关系,点击:

显示的字段为粉红色。要设置/取消显示的字段,点击“选择显示字段”图标,然后选择需要的字段名。

6.32 How can I use the zoom search feature?

The Zoom search feature is an alternative to table search feature. It allows you to explore a table by representing its data in a scatter plot. You can locate this feature by selecting a table and clicking the 'Search' tab. One of the sub-tabs in the 'Table Search' page is 'Zoom Search'.

Consider the table REL_persons in FAQ 6.6 for an example. To use zoom search, two columns need to be selected, for example, id and town_code. The id values will be represented on one axis and town_code values on the other axis. Each row will be represented as a point in a scatter plot based on its id and town_code. You can include two additional search criteria apart from the two fields to display.

You can choose which field should be displayed as label for each point. If a display column has been set for the table (see FAQ 6.7), it is taken as the label unless you specify otherwise. You can also select the maximum number of rows you want to be displayed in the plot by specifing it in the 'Max rows to plot' field. Once you have decided over your criteria, click 'Go' to display the plot.

After the plot is generated, you can use the mousewheel to zoom in and out of the plot. In addition, panning feature is enabled to navigate through the plot. You can zoom-in to a certail level of detail and use panning to locate your area of interest. Clicking on a point opens a dialogue box, displaying field values of the data row represented by the point. You can edit the values if required and click on submit to issue an update query. Basic instructions on how to use can be viewed by clicking the 'How to use?' link located just above the plot.

phpMyAdmin 项目

7.1 我发现了一个缺陷。怎样向开发者报告?

我们的缺陷追踪器位于 http://sf.net/projects/phpmyadmin/ 的 Bugs 功能块。

但请先和其他用户讨论你发现的问题:
https://sourceforge.net/projects/phpmyadmin/forums

7.2 怎样开始翻译一个新的语言或更新现有的语言?

永远使用最新的 Git 版本的 po 文件来翻译。你也可以选择在我们的翻译服务器在线翻译,也可在此获得最新的 po 文件并与你的翻译合并。使用 po/phpmyadmin.pot 生成 po/语言代码.po 即可为你的语言创建新的翻译 (可以使用 msginit -i po/phpmyadmin.pot -l 语言代码 --no-translator -o po/语言代码.po) 或通过邮件列表寻求在 web 界面上添加翻译。更多详细信息请见我们的维基

请注意自从我们对文件定义了正确的编码后,我们尝试不在翻译中使用诸如 &eacute; 的 HTML 实体。 若使用 HTML 实体,JavaScript 消息中的文本将可能不能正确显示。 不论怎样有些实体还是必需的: 引号、不可分空格、& 符号、小于号、大于号。

然后你可以将你的翻译,或者打包压缩成 zip 文件来避免丢失特殊字符,放在 sourceforge.net 的翻译追踪器上。

你还可以订阅 phpMyAdmin 翻译 邮件列表,当我们有新文本需要翻译时就会在那发出通知。

文档是通过 po4a 和 gettext 翻译的 (参见文档查看现有的翻译) 。要开始翻译,先从 Git 检出 localized_docs/po,或者直接到翻译服务器在线翻译。如果没有找到你的语言,请联系 Michal Čihař; 他会加上。如果你更喜欢直接翻译 po 文件,请将翻译好的文件放在我们的翻译追踪器上。

7.3 怎样帮助开发 phpMyAdmin ?

对新开发者推荐以下方式:

  1. 通过匿名方式获取当前 git 库:
    git clone git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
  2. 添加你的内容
  3. 生成你的补丁: git diff > xxx.diff
  4. 通过 phpMyAdmin 项目的补丁追踪器提交你的补丁。

更多关于 git 的详细信息请见我们的维基

库的写入权限仅授予给那些对 phpMyAdmin 作出大量贡献且富有经验的开发者。
同时,请看一下开发一节。

安全

8.1 哪里可以了获取 phpMyAdmin 的安全公告信息?

请参见 http://www.phpmyadmin.net/home_page/security.php

8.2 怎样保护 phpMyAdmin 防止暴力破解?

如果你使用 Apache 服务器,phpMyAdmin 会导出认证信息到 Apache 环境并可被 Apache 日志使用。 目前有两个变量可用:

userID
当前活动用户的用户名 (他不一定需要登录)。
userStatus
当前活动用户的状态,有 ok (用户已登录)、mysql-denied (MySQL 拒绝用户登录)、allow-denied (用户被允许/禁止规则禁止)、root-denied (root 用户登录在配置文件中被禁止)、empty-denied (禁止空密码登录) 这几种状态。

可以像这样设置 Apache 的 LogFormat 指令:

LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n"   pma_combined

然后你可以使用任何日志分析工具来检测潜在的攻击。

同步

9.1 怎样在 phpMyAdmin 中同步两个数据库/表?

你可以使用 phpMyAdmin 的同步功能同步数据库/表。该功能可以连接到本地或者远程服务器。但需要你输入服务器主机名、用户名、密码、端口和数据库名。然后你就可以在相同或不同的服务器间同步数据库了。

该功能对需要复制数据库结构和数据的开发者们是很有帮助的。此外,该功能并不仅限于复制,还能帮助用户保持他们的数据库和另一个数据库同步。除了可以同步整个数据库外,也可以只同步数据库的部分数据表。

你需要填写服务器的主机名、MySQL 中已存在的用户名和密码。端口默认是 3306 (MySQL 默认端口)。最后是数据库名。源数据库和目标数据库除了端口外的信息都要填写准确。

在成功通过认证阶段后,将会以表格形式显示出源和目标数据库中的数据表名。

在左侧会列出源数据库中的表。部分表的名字前会有一个 + 加号。表示这些表仅在源数据库中存在并且需要在同步到目标数据库时添加到目标数据库。名字前没有 + 加号的表已存在于目标数据库中。

在左侧会列出目标数据库中的表。部分表的名字后会有 (未找到) 字样。表示这些表将在与源数据库同步时添加到目标数据库。部分表的名字前会有一个 - 减号。表示这些表仅在目标数据库中存在并且不会被修改。位于中间的一列表示源/目标对应表之间的区别。

红色 S 和绿色 D 按钮表示结构 (S) 或数据 (D) 是否需要更新。当点击按钮时,它们将变成灰色,表示相应表将会被同步。

开发信息

phpMyAdmin 是开源的,我们欢迎您的参与。很多优秀的功能都不是我们写的,你同样可以帮助 phpMyAdmin 变成更加实用的工具。

如果您正打算贡献源代码,请阅读以下信息:

Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com>
Copyright (C) 2001-2012 Marc Delisle <marc_at_infomarc.info>
                        Olivier Müller <om_at_omnis.ch>
                        Robin Johnson <robbat2_at_users.sourceforge.net>
                        Alexander M. Turek <me_at_derrabus.de>
                        Michal Čihař <michal_at_cihar.com>
                        Garvin Hicking <me_at_supergarv.de>
                        Michael Keck <mkkeck_at_users.sourceforge.net>
                        Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
                        [check credits for more details]

本软件是自由软件,你可以在自由软件基金会发布的 GNU 通用公共许可协议第 2 版的许可下重新修改并/或发布。

本软件因希望能对大家有用而发布,但没有任何担保,也没有任何适销性或针对特定用途的隐含的担保。参见 GNU 通用公共许可协议获得详细信息。

你应该在获得此软件的同时收到一份 GNU 通用公共许可协议的副本如果没有,请致函 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

鸣谢

按时间先后顺序

以及自 2.1.0 版以来对功能修改、增强、缺陷修正和新语言支持作出贡献的人们:

Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, Péter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, Mats Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kläger, Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, Andreas Pauley, Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval Sarna, www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, Peter Svec, Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, Luís V., Martijn W. van der Lee, Algis Vainauskas, Daniel Villanueva, Vinay, Ignacio Vazquez-Abrams, Chee Wai, Jakub Wilk, Thomas Michael Winningham, Vilius Zigmantas, "Manuzhai".

版本 2.1.0 的鸣谢原文

此项目基于 Peter Kuppelwieser 的 MySQL-Webadmin 而来。他想出了通过 PHP3 来建立一个基于 web 的 MySQL 交互界面这个点子。尽管我没有使用他的源代码,但很多想法都是受他而启发。我之所以启动 phpMyAdmin 这个项目是因为 Peter 告诉我他不再开发他 (优秀) 的工具了。

在这里要感谢

感谢下列对小的修改、改进、缺陷修正以及新语言支持作出贡献的人们:

Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas Kleemann, Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel Piankov, Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, Jannis Hermanns, G. Wieggers.

同时感谢所有给我们提出建议、意见、报告缺陷以及使用反馈的热心用户。

This translation was brought to you by various translators on translation server. They should have written their names here.

词汇表

源自维基百科,自由的百科全书