这是一份 phpMyAdmin
文档的翻译。你可以到翻译服务器来帮助我们完善它。
环境需求
- PHP
- 开启 会话 (session) (参见 FAQ 1.31) 、标准 PHP 库 (SPL) 和 JSON
扩展的 PHP 5.2.0 或更高版本。
- 要支持上传 zip 文件,需要 zip 扩展。
- 为了更好的支持多字节字符串 (如 UTF-8 编码的文字, 当前默认编码),你应该安装 mbstring 和 ctype 扩展。
- 要支持内联 JPEG 图像的等比缩略图 ("image/jpeg: inline"),需要 GD2 扩展
- 当使用 "cookie" 认证时,我们强烈建议大部分用户使用
mcrypt (外链,英语)
扩展,在64位计算机中,该扩展是必须的。不使用 mcrypt 扩展可能导致打开 phpMyAdmin 页面时变得很慢。
- 要支持上传进度条,参见 FAQ 2.9。
- 要支持 BLOB 流,参见 FAQ 6.25 中所述的 PHP 和 MySQL 需求。
- To support XML and Open Document Spreadsheet importing, you need PHP 5.2.17
or newer and the libxml
extension.
- MySQL 5.0 或更高版本 (查看详细说明);
- 支持 cookies 的浏览器。
介绍
在有超级用户的情况下,phpMyAdmin 可以像管理一个数据库一样管理整个 MySQL 服务器。要实现这些功能你需要正确设置 MySQL
用户能够读/写的数据库。你可以在 MySQL 手册中找到相关内容。
目前 phpMyAdmin 具有的功能有:
- 浏览、删除数据库、数据表、视图、字段和索引
- 创建、复制、删除、改名以及修改数据库、数据表、字段和索引
- 用服务器中设置好的计划维护服务器、数据库、数据表
- 运行、编辑一条或多条任意 SQL
语句,并加入书签
- 将文本文件载入数据表
- 创建1、读取数据表的转储
- export1 data to various formats: CSV, XML, PDF,
ISO/IEC 26300 -
OpenDocument Text and Spreadsheet, Word, and LATEX formats
- import data and MySQL structures from OpenDocument spreadsheets, as well as
XML, CSV, and SQL files
- 管理多个服务器
- 管理 MySQL 用户和权限
- 检查 MyISAM 数据表的引用完整性
- 使用依例查询 (QBE),自动创建复杂的多表关联查询
- 创建 PDF 格式的数据库布局图
- 对全部或部分数据库的搜索
- 通过预定义函数转换现有数据为任意格式,如显示二进制大对象 (BLOB) 数据为图像或下载链接
- 追踪对数据库、数据表和视图的修改
- 支持 InnoDB 数据表和外键 (参见 FAQ 3.6)
- 支持改进的 MySQL 扩展 mysqli (参见 FAQ 1.17)
- create, edit, call, export and drop stored procedures and functions
- create, edit, export and drop events and triggers
- 支持 62 种语言
- 同步当前或远程服务器上的任意两个数据库 (参见 FAQ 9.1)
关于用户:
很多人难以理解 phpMyAdmin 用户的概念。当一个用户登录到 phpMyAdmin 的时候,用户名和密码是被直接发送到 MySQL
的。phpMyAdmin 本身并没有任何用户管理行为 (有 MySQL 管理权限的用户可以通过 phpMyAdmin 管理其他的 MySQL
用户),所有用户必须是有效的 MySQL 用户。
安装
- 快速安装
- 使用安装脚本
- phpMyAdmin 高级功能
- 从旧版本升级
- 使用认证
phpMyAdmin 不会在 MySQL 数据库服务器上应用任何特殊的安全措施。正确设置 MySQL
数据库的权限是系统管理员应该做的。phpMyAdmin 的 "权限" 页面可以帮助系统管理员设置权限。
Mac 用户注意:
如果你使用的 Mac OS 版本低于 OS X,StuffIt 会把文件解压成 Mac 格式。
因为 PHP 好像不支持 Mac 式的换行符
("\r"),所以在上传到服务器之前,你必须把所有 phpMyAdmin 脚本用 BBEdit 重新保存为
Unix 格式。
快速安装
- 从 phpmyadmin.net 下载页选择一个合适的版本。有些版本只有英语,有些只使用 UTF-8 编码且包含了所有语言
(适用于大多数情况),还有些包含了所有语言和所有编码。现在我们假设你选择的是一个像
phpMyAdmin-x.x.x-all-languages.tar.gz 这样名字的版本。
- 解开这个压缩包 (连同子目录一起解压): 在你网站服务器的文档根目录执行 tar -xzvf
phpMyAdmin_x.x.x-all-languages.tar.gz
。如果你没有直接的访问服务器的权限,先把这些文件解压到你自己的电脑上,等完成第 4 步之后,再通过 ftp 等方式上传到你的网站服务器上。
- 确保所有的脚本都有正确的所有者 (如果 PHP 运行于安全模式,所有者的不同可能会导致问题)。参见 FAQ 4.2 和 FAQ
1.26。
- 现在你需要做一些设置。通常我们会手动编辑一份 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 # 删除不需要的目录
现在配置文件保存好了。如果你要检查当前设置或者要设置一些安装脚本中没有提供的高级功能,你可以用你最喜欢的编辑器来编辑它。
- 如果使用 "config" 认证,你应该保护好 phpMyAdmin 的安装目录,因为 config
认证不会要求用户输入密码。我们建议使用其他认证,如在 .htaccess 文件中设置
HTTP 认证或修改设置让 phpMyAdmin 使用 cookie/http 认证。更多信息参见 FAQ 中的 多用户
一节,特别要注意 FAQ 4.4 中所提到的问题。
- 在浏览器中打开 phpMyAdmin 主目录。现在 phpMyAdmin
应该显示一个欢迎页面和你的数据库,如果使用 HTTP 或 cookie 认证,则将显示一个登录对话框。
- 你应该在你的网站服务器中设置禁止对 ./libraries 和 ./setup/lib 这两个子目录的访问。在
Apache 中你可以通过 .htaccess 文件设置,其他网站服务器请自行设置。通过设置来预防可能的路径泄露以及跨占脚本攻击,加强服务器的安全性。
-
禁止搜索引擎访问公开的 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.php 为
config.inc.php 因为默认配置是仅对当前版本有效的。
如果你把 MySQL 服务器从 4.1.2 之前的版本升级到了 5.x 或更高版本,并且使用 phpMyAdmin 高级功能,你还要运行 SQL 脚本
scripts/upgrade_tables_mysql_4_1_2+.sql 。
使用认证
- 在多用户环境中,我们推荐使用 HTTP 和 cookie 认证,这样用户仅可以看到并管理自己的数据库。
目前已知微软的 IE6 (Internet Explorer,或更低版本) 在处理 cookies 上存在严重问题。
即使在单用户环境中使用 HTTP 或 cookie 认证,用户名和密码也不会被保存在配置文件中。
- HTTP 和 cookie
认证更加安全: 除了可能需要的 控制用户,MySQL 登录信息不会被保存在 phpMyAdmin
的配置文件中。
不论如何,如果你不使用 HTTPS 协议,密码将总是以明文传输。
当使用 cookie 认证时,密码将经过 blowfish 算法加密并保存在一个临时 cookie 中。
- 注意: 本节仅适用于运行在 --skip-show-database 模式下的 MySQL 服务器。
当使用 'HTTP' 和
'cookie' 认证时,phpMyAdmin 需要一个在 `mysql`.`user` (除 `Password`
之外的所有字段)、`mysql`.`db` (所有字段)、`mysql`.`host` (所有字段) 和
`mysql`.`tables_priv` (除 `Grantor` 和 `Timestamp` 之外的所有字段)
数据表中仅具有 SELECT 权限的控制用户。
你必须在 config.inc.php 中的 $cfg['Servers'][$i]['controluser'] 和
$cfg['Servers'][$i]['controlpass'] 设置中设置好控制用户。
下例演示了如何使用 pma 作为控制用户以及 pmapass 作为控制用户的密码,需要注意的是:
这仅仅是个示范,请在你的配置文件中使用不同的用户名和密码!在 phpMyAdmin SQL 查询窗口或 MySQL
命令行客户端中输入下列命令。
如果网站服务器和 MySQL 服务器并不在同一台服务器上,你要将 localhost 换成正确的地址。
GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
GRANT SELECT (
Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
Execute_priv, Repl_slave_priv, Repl_client_priv
) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'pma'@'localhost';
GRANT SELECT ON mysql.host TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
ON mysql.tables_priv TO 'pma'@'localhost';
如果你想使用书签以及相关的新功能,还要执行:
GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
(需要设置好 phpMyAdmin 高级功能)。
- 每一个真实的用户应在特定的数据库上具有一定的权限。除非你很明白这些权限的作用
(例如,需要创建一个超级用户),否则不应轻易授予普通用户任何全局权限。
如,授予用户 real_user 对数据库 user_base 的所有权限:
GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
现在这个用户可以做什么已经完全被 MySQL 用户管理系统控制了。
HTTP 和 cookie
认证不需要填写 $cfg['Servers']
数组中的用户/密码一栏。
'HTTP' 认证
- 通过 HTTP
基本认证可以使用任何合法的 MySQL 用户登录。
- 大部分 PHP 设置都支持。参见 FAQ 1.32 了解如何设置在 IIS 中以 (ISAPI) 和 CGI 方式使用的 PHP,参见 FAQ
1.35 了解如何设置在 Apache 中以 CGI 方式使用的 PHP 。
- 参见 FAQ 4.4 关于不要同时使用 .htaccess 和 'HTTP' 认证的问题。
'cookie' 认证
- 可用它来代替 HTTP 认证
(如,使用 IIS
作为网站服务器时)。
- 当然,用户必须开启浏览器的 cookies 支持,不过现在所有的认证方式都需要 cookies 。
- 使用该认证时,用户可以真正的退出 phpMyAdmin 并用相同的用户名再次登录。
- 如果想登录到任意服务器,参见
$cfg['AllowArbitraryServer'] 指令。
- 在环境需求一节中我们提到过,可选的 mcrypt 扩展可以显著提高访问速度。
'signon' 认证
- 使用该认证时,用户可以通过第三方应用程序来登录到 phpMyAdmin 。
- 第三方应用程序需要在会话数据中保存登录信息。
- 更多详情请参见认证一节。
'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.php 和 config.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' 。
要启用此功能:
-
$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.
- $cfg['LeftDisplayLogo'] boolean
- Defines whether or not to display the phpMyAdmin logo at the top of the left
frame. Defaults to TRUE.
- $cfg['LeftLogoLink'] string
- 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'] 。
- 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.
-
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.
- 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.
- 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.
- 介绍
- 使用
- 文件结构
要开启转换功能,你必须设置好 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.
打开到你的 tbl_structure.php 页面 (如: 通过点击一张表的 '结构' 链接) 。点击 "修改"
(或修改图标) 后你就能看到在最下方多出三栏。它们分别叫 'MIME 类型'、'浏览器转换' 和 '转换选项' 。
- 'MIME 类型' 是一个下拉框。选择与字段内容一致的 MIME 类型。请注意如果没有选择任何 MIME 类型转换功能是不起作用的。
- '浏览器转换' 是一个下拉框。你可以从预定义好的转换中选择一个你想要的转换。后面会介绍如何编写你自己的转换。
转换分为全局转换和固定类型转换。全局转换可用于任何类型。在必要的时候,它们会注意类型。 固定类型转换通常只针对特定的类型。它们喜欢将一个大类 (如
'图像') 转换成一个小类 (如 'JPEG 图像') 。
你可以转换一个未定义的类型。程序没有检查你是否选择了正确的转换,请小心使用。
- '转换选项' 是一个输入框。在这里你要输入转换函数所需的选项。虽然它们通常可以使用默认选项,但最好还是看看有哪些是必选项。
Much like the ENUM/SET-Fields, you have to split up several options using
the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is because
internally the options will be parsed as an array, leaving the first value
the first element in the array, and so forth.
If you want to specify a MIME character set you can define it in the
transformation_options. You have to put that outside of the pre-defined
options of the specific mime-transform, as the last value of the set. Use
the format "'; charset=XXX'". If you use a transform, for which you can
specify 2 options and you want to append a character set, enter "'first
parameter','second parameter','charset=us-ascii'". You can, however use the
defaults for the parameters: "'','','charset=us-ascii'".
所有类型和转换是都通过 '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 种可能的文件名:
- 一个类型与子类型的转换:
[类型]_[子类型]__[转换].inc.php
请注意类型和子类型通过 '_' 分隔,且不包含它们的名字。转换函数/文件名只能使用字符,这样不会导致文件系统和 PHP 函数名转换的问题。
转换函数则为 'PMA_transform_[类型]_[子类型]__[转换]()' 。
例:
text_html__formatted.inc.php
PMA_transform_text_html__formatted()
- 一个类型 (没有子类型) 转换:
[类型]__[转换].inc.php
请注意是两个 '_' 符号。 转换函数/文件名只能使用字符,这样不会导致文件系统和 PHP 函数名转换的问题。
转换函数则为 'PMA_transform_[类型]__[转换]()' 。
例:
text__formatted.inc.php
PMA_transform_text__formatted()
- 一个类型与子类型但没有转换函数
[类型]_[子类型].inc.php
请注意文件名中没有 '__' 符号。请勿在文件名中使用可能导致文件系统问题的特殊字符。
文件中不定义转换函数。
例:
text_plain.inc.php
(无函数)
- 一个类型 (没有子类型) 但没有转换函数
[类型].inc.php
请注意文件名中没有 '_' 符号。请勿在文件名中使用可能导致文件系统问题的特殊字符。
文件中不定义转换函数。
例:
text.inc.php
(无函数)
- 一个不带类型的全局转换函数
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 创建新的类型。
一个转换函数将被传入三个参数:
- $buffer - 包含字段中的内容。也是你将要转换的内容。
- $options - 以数组形式保存的用户输入的转换选项。
- $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 - 常见问题
- 服务器
- 设置
- 已知问题
- 互联网服务提供商、多用户安装
- 浏览器和客户端操作系统
- 使用 phpMyAdmin
- phpMyAdmin 项目
- 安全
- 同步
请到我们的官方网站上查看更多有关
phpMyAdmin 的特性和接口方面的信息。
服务器
在 config.inc.php 文件中将 $cfg['OBGzip'] 显式地设为 FALSE,同时将 PHP 配置文件中的
zlib.output_compression 显式地设置为 Off。
请将 Apache 更新到最新版本(如果可能的话,请将 MySQL 也更新到最新版本)。
参考 常见问题 1.1 中有关 PHP 输出缓冲的问题。
如果你的服务器依旧崩溃,请向 Apache 技术支持小组寻求帮助。
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.
这是一个已知的 PHP ISAPI 过滤器错误:PHP 的 ISAPI 过滤器不是很稳定,建议使用 cookie 认证方式。
这看上去像是 PWS 的 Bug。Filippo Simoncini 找到了一个解决方法,这是目前最好的解决方法:从
libraries/header.inc.php, libraries/header_printview.inc.php,
index.php, navigation.php 和 libraries/common.lib.php
这几个文件中删除 DOCTYPE(共2行)。
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).
您上传的文件被保存在 "上传目录",这个目录可以在 php.ini 中设置(默认设置是 /tmp)。
我们推荐您按照下面的步骤将 Apache 服务器配置在安全模式下运行,这可以保证安全的前提下允许上传文件(本操作仅适用于类 Unix 操作系统):
- 创建一个用于临时保存上传文件的目录:mkdir /tmp/php
- 将这个目录的所有权更改为 Apache 用户组:chown apache.apache /tmp/php
- 设置权限:chmod 600 /tmp/php
- 修改 php.ini 文件,将 upload_tmp_dir 设置为
/tmp/php(如果没有这一行,请自行添加)
- 重新启动 Apache
"Rob M" 在 PHP 帮助论坛给出了解决方法:将下面一行加入到您的 httpd.conf 文件中
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
该方法似乎可以解决许多使用 Internet Explorer 或 SSL 时遇到的问题。
从 2.2.4 版本开始,phpMyAdmin 支持服务器上的开放目录限制(open_basedir
restrictions)。但是,你需要进行设置才能使用此功能。请创建一个临时目录,并将 $cfg['TempDir'] 设置为临时目录的路径。您上传的文件将会被临时存放在此目录下,SQL
语句执行完毕以后,临时文件就会被删除。
The MySQL manual explains how to reset
the permissions.
In previous MySQL versions, the User and Passwordcolumns
were named user and password. Please modify your column
names to align with current standards.
phpMyAdmin 在 2.7.0 重写了导入引擎,并修复了以上问题。如果可能,请升级 phpMyAdmin 到最新版本,并体验 phpMyAdmin
新版给您带来的新特性。
请检查 php.ini 文件中的 upload_max_filesize、 memory_limit
以及 post_max_size 的设置值。这三个选项都会影响您可以上传的文件大小和 PHP
能够处理的文件大小。如果您没有服务器管理权,请联系服务器管理员(或服务器提供商)检查这几项设置。另外,有用户反应 post_max_size 和
memory_limit 的设置值必须比 upload_max_filesize 的设置值大。
如果您上传的文件很大,或者服务器管理员或提供商不愿意修改以上几个设置,请参考下面的解决方法:
- 设置 $cfg['UploadDir']。设置该值后,您可以使用 SCP、FTP
或其他您喜欢的上传方式,将文件上传到临时目录,之后让 phpMyAdmin 从临时目录中读取文件。详细说明请参考本手册的设置 一节。
- 使用第三方工具(如
BigDump)来将上传文件分割成小文件。phpMyAdmin 能够处理分割文件。但是,我们担心用户是否知道应该如何进行文件分割操作。
- 如果您能够使用 MySQL 的命令行,您可以直接在命令行中导入文件。您可以使用 MySQL 的 source 命令来导入文件,例如:source
filename.sql。
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.
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 手册。
在此功能中我们使用了 "FPDF" 库,该库还需要其他的一些文件才能使用自定义字体(font faces)。
请参考 FPDF 手册 来生成这些必要的文件。
要连接到 MySQL 服务器,PHP 需要使用 MySQL 扩展中相关的 MySQL 函数。这个扩展应该需要编译到 PHP
中,或者以动态方式加载。如果是以动态方式加载,动态库的文件有可能是 mysql.so 或
php_mysql.dll。phpMyAdmin 试图加载动态库文件,但加载失败了。
通常情况下,安装 "PHP-MySQL" 或者其他类似的软件包即可解决此问题。
在 php.ini 文件中将 mysql.max_links 设为比1大的值。
通常这是因为您没有在 php.ini 中将 file_uploads 选项设置为 "on"。
这是因为 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';
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。
这是一个权限问题。右键单击 phpMyAdmin 目录,选择 属性-->-->安全-->增加,然后选择在用户列表中选择
IUSR_machine 用户,赋予其权限,即可解决此问题。
这是一个 PHP 错误,该错误会在打开 GZIP
输出的时候发生。如果您在 config.inc.php 中修改 $cfg['OBGzip'] = false 选项来关闭这个功能,就能解决此问题。这个错误将会在
PHP 5.0.0 版本中修复。
这个错误可能是因为 lower_case_table_names 被设为了1,而数据库中存在表名为大写的表,这是 MySQL
的一个错误。要解决此问题,请先显示地将 lower_case_table_names 设为
false,然后将所有表名改为小写,最后再重新将 lower_case_table_names 设为 true。MySQL
3.23.56 / 4.0.11-gamma 版本已经修复了这个问题。
这可能是因为没有正确配置 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
产正这个问题的原因是您的服务器上运行着 Turck MMCache,升级 MMCache 到 2.3.21 版本就可解决此问题。
当然支持。
phpMyAdmin 3.0 及之后的版本只能在 PHP 5.2 或更新的版本上运行。对于旧版本的 PHP,请使用 phpMyAdmin 2.9
版本分支,这个分支版本目前还在维护中。
可以。我们在 IIS 5.1 上以 ISAPI 方式加载 PHP 4.3.9,使用 phpMyAdmin 2.6.1 版本进行测试,结果可以正常使用
phpMyAdmin。
- 请在 php.ini 文件中将 cgi.rfc2616_headers 设为0。
- 打开站点属性——>目录安全性——>匿名访问对话框,选中“启用匿名访问“,并去掉“基本身份验证“”集成 Windows
身份验证“和“Windows 域服务器的摘要试身份验证“以及其他的复选框。
- 在自定义错误选项卡中,选中401;1到401;5条目,然后点击设为默认按钮。
当然可以。您可以直接输入类似
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 FollowSymLinks 和 AllowOverride
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]
可以,但您需要设置以下重写规则,以便将登录参数传送给 CGI:
RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
导致这种情况的原因有很多种,请查看您的服务器错误日志,其中可能包含了有关的错误信息。
如果您的集群中存在不同体系结构的系统,就会导致 PHP 无法使用 pack/unpack 函数进行正确的加解密操作。解决此问题的方法是使用 mcrypt
扩展。
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.
请确认您在 Apache 的配置文件中启用了 SSLOptions 和 StdEnvVars。具体请参考 http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions。
要在此方式下使用 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。
MySQL 服务器的权限表没有更新,请运行 mysql_upgrade 命令来进行更新。
设置
请检查 config.inc.php 文件,确保在 <?php 之前和 ?>
标签之后没有任何字符(包括空格、制表符以及空行等)。在 IIS 上使用 zipped 功能的用户同样向我们反馈了类似问题,在
libraries/Config.class.php 文件末尾有一个行尾符(ASCII 码为 0A),删除此字符即可解决问题。
这可能是因为您的 PHP 配置有误,或者您使用的登录名和密码错误。请写一个脚本,使用 mysql_connect 来尝试是否能连接到 MySQL
服务器,如果不能,就说明您可能没有将 MySQL 编译到 PHP 中,或者没有加载 MySQL 库。
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 给出了另一种解决方案:
- 首先你需要确定 MySQL 使用了何种类型的 socket,请按照下面的步骤进行操作:
用终端连接到你的 MySQL 服务器并切换到 MySQL 的 bin 目录,在这个目录下你应该能找到一个名为 mysqladmin
的文件。执行 ./mysqladmin variables 命令,你就能得到 MySQL 服务器的信息,其中包括了 socket
信息(类似 /tmp/mysql.sock)。
- 接下来,设置 PHP 让它使用这个 socket。
打开 phpMyAdmin 的 config.inc.php 文件。
将
$cfg['Servers'][$i]['socket'] 修改为刚才得到的 socket。
同时请确此文件能被网站服务器进程读取(如将其掩码设为 0755)。
Have also a look at the
corresponding section of the MySQL documentation.
请在 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.
请在 phpMyAdmin 的配置文件中检查您是否显式地设定了 $cfg['PmaAbsoluteUri']。
当您在自己的机器上(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 链接,就可以正常登录了。
有关主题的设置项是:$cfg['ThemePath'],
$cfg['ThemeManager'] 以及
$cfg['ThemeDefault']。
请不要修改 $cfg['ThemePath']
选项设置的目录下的文件结构,更不要删除这个目录。这个目录是 phpMyAdmin 的系统主题,如果一些主题缺少某些文件,phpMyAdmin
就会使用系统主题的文件替代之。
如果设置了 $cfg['ThemeManager'],您就可以在 phpMyAdmin
主页面中选择喜欢的主题。您使用的主题名字将会保存在 cookie 中。
要创建一个主题,请按照下面的方法进行操作:
- 在 $cfg['ThemePath']
(默认值是themes) 设置的目录下创建一个新目录。
- 复制 "original" 目录下所有的文件到您朝见的目录中。
- 在您创建的目录下,打开 css 子目录,修改其中的层叠样式表文件。
- 将您的图片复制到您创建的主题目录下的 img 子目录中。
- 在您创建的目录下有一个 layout.inc.php 文件,按您的需要编辑此文件。
- 在您的主题目录下还有一个 info.inc.php 文件,您可以在这个文件中设置您的主题名字。
- 为您的主题截图,并将截图保存到主题目录下,将其命名为 screen.png。
在主题目录下有一个 info.inc.php 文件,其中包含了主题全名和主题版本号。主题版本号由您自行设定,不需要符合
phpMyAdmin 的版本号,只需要保证版本号是纯数字就行。拥有相同主版本号(generation
number)的主题应该向下兼容。子版本号为2的主题应该能在使用子版本1主题的 phpMyAdmin 上正常显示。主版本号不相同的主题无须相互兼容。
如果您没有自己主题的图标和按钮,请删除您的主题目录下的 img 目录。phpMyAdmin 将使用默认的图标和按钮(位于 original
目录下的系统主题)。
请先检查以下几点:
- 在 config.inc.php 文件中,显式地将 $cfg['PmaAbsoluteUri'] 设置为空。请参考常见问题 4.7.
- 可能您安装的 PHP 版本有问题,试试升级 Zend Optimizer。请参考
http://bugs.php.net/bug.php?id=31134。
- 如果您使用 Hardened PHP 并在 php.ini 中将 varfilter.max_request_variables
显式地设为了小于等于默认值(200)的值,就可能会导致此问题。如果您的表中有很多字段,请增加此设置的值(感谢 Klaus Dorninger
提供的信息)。
- 如果在 php.ini 中的选项 arg_separator.input
被设置为";"就有可能导致此问题。请将其设置为 "&;"。
- 如果您正在使用 Hardened-PHP,请增大 request
limits 的设置值。
- 如果 php.ini 中的选项 session.save_path
设定的目录不存在或者目录权限为只读,也有可能导致此问题。
要使用此功能,请在服务器上安装 APC 扩展或 uploadprogress,并启用
JSON 扩展。
如果使用 APC,请在 php.ini 中将 apc.rfc1867 设为 on。
Known limitations
这是 phpMyAdmin 的认证机制引起的问题。要解决此问题,请关闭所有已打开的 Windows 文件夹,然后重新登录 phpMyAdmin。
压缩转储在内存中进行,而 PHP 对内存的使用有限制。从 2.5.4 版本开始,可以使用 Gzip/BZip2 导出来解决此问题。启用 $cfg['CompressOnFly']
选项(默认已启用)。此方法不支持 Zip 导出,要进行 Zip 导出,需要使用其他的方法。
这是一个 InnoDB 引擎的错误,请参考:http://bugs.mysql.com/bug.php?id=21704。
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
错误的注释是那行由短横线组成的水平线,正确的注释应该是两个短横线后面跟一个空格。所以,要解决此问题,请在水平线的前两个短横线后加上一个空格,或直接在水平线的前面加上一个#符号,就像下面这样:
-- -------------------------------------------------------
或者
#---------------------------------------------------------
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
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.
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.
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.
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
Please make sure that your table has a primary key, so that phpMyAdmin can
use it for the Edit and Delete links.
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.
The tests I have made with MySQL 5.1.49 shows that the API does not accept
this syntax for the USE command.
This has been a known limitation of phpMyAdmin since the beginning and it's
not likely to be solved in the future.
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.
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
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".
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:
-
Your config.inc.php file should be chmod 660.
-
All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy is a
user whose password is only known to you, and apache is the group under
which Apache runs.
-
Follow security recommendations for PHP and your webserver.
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.
This could happen for several reasons:
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).
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',
);
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.
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
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.
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.
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.
MS Internet Explorer seems to be really buggy about cookies, at least till
version 6.
Upgrade to at least Internet Explorer 5.5 SP2.
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.
Some browsers support right-clicking into the frame you want to refresh,
just do this in the right frame.
Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future
Mozilla versions.
This is a Mozilla bug (see bug #26882 at BugZilla).
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.
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.
This issue has been reported by a OS X
user, who adds that Chimera, Netscape and Mozilla do not have this problem.
This is a bug in Internet Explorer, other browsers do not behave this way.
Please upgrade to Opera7 at least.
Please upgrade to at least version 1.2.3.
Please check the following points:
- Maybe you have defined your PmaAbsoluteUri setting in
config.inc.php to an IP
address and you are starting phpMyAdmin with a URL containing a domain name, or the reverse situation.
- Security settings in IE and/or Microsoft Security Center are too high, thus
blocking scripts execution.
- The Windows Firewall is blocking Apache and MySQL. You must allow HTTP ports (80 or 443) and MySQL
port (usually 3306) in the "in" and "out" directions.
Many users have confirmed that the Tabbrowser Extensions plugin they
installed in their Firefox is causing the problem.
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.
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
仔细检查 SQL
错误。这个问题通常是因为指定了错误的字段类型。
常见错误有:
- 不给 VARCHAR 设置大小参数
- 给 TEXT 或 BLOB 设置大小参数
同时,请参考 MySQL 手册中语法一章确定你的语法都正确。
这是一种创建多字段索引的方法。如果你需要两个索引,在建表时先设置一个,保存,然后显示数据表属性并点击索引链接来创建另一个索引。
自 2.2.3 版起,每个字段都有一个复选框来设置字段是否为空。 2.2.3 之前,你只能输入
"null",不包括引号来作为字段的值。自 2.5.5 版起,你可以使用复选框来获得一个真正的空 (NULL) 值,如果你输入
"NULL" 将表示文字 NULL,而不是空 (NULL) 值 (对 PHP4 同样有效)。
在左侧框架中点击数据库或表名,将会显示它们的属性。 然后在菜单上点击 "导出",你可以转储结构和/或数据。该功能将生成标准
SQL
语句以便重新创建你的数据库/表。
若选择 "保存为文件",phpMyAdmin 即可将转储结果直接提供下载。取决于 PHP 的配置,你还能看见压缩选项。同时请参见
$cfg['ExecTimeLimit']
配置变量。
要获得更多关于该主题的帮助,请在本文档中查找 "转储" 。
在左侧框架中点击数据库或表名,将会显示它们的属性。在右手边框架中的标签列表中选择 "导入" (或 "SQL" 如果你的 phpMyAdmin
版本低于 2.7.0)。在 "文本文件的位置" 中输入你的转储文件名,或使用浏览按钮。然后点击执行。
2.7.0 版的导入功能已经重写了,建议尽可能升级以使用新功能。
要获得更多关于该主题的帮助,请在本文档中查找 "上传" 。
下面用数据库 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');
设置对应连接并显示信息:
- 在表 "REL_persons" 上点击结构、关系查看
- 在关系中,"town_code" 选择 "REL_towns->code"
- 在关系中,"country_code" 选择 "REL_countries->country_code"
- 在表 "REL_towns" 上点击结构、关系查看
- 在 "选择要显示的字段" 上选择 "description"
- 在表 "REL_countries" 中重复以上两步
测试步骤如下:
- 在左侧框架中点击你的数据库名
- 选择 "查询"
- 使用表: persons、towns、countries
- 点击 "更新查询"
- 在字段行中,选择 persons.person_name 并选中 "显示" 复选框
- 为 towns.description 和 countries.descriptions 在另两列中重复上一步
- 点击 "更新查询" 你就能在查询框中看到已生成的 join 语句
- 点击 "提交查询"
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.
首先要设置好 "relation"、"table_coords" 和 "pdf_pages"
变量。
然后你要确定你的大纲布局。每张表分别放在第几页。
- 在左侧框架中选择数据库。
- 在顶部导航条上点击 "操作" 。
- 点击页面底部的 "编辑 PDF
页" 。
- 输入第一页 PDF
的名称然后点击执行。你还可以使用 "自动排版" 功能,它能将有关系的表都放入新页。
- 选择刚才创建的新页 (单选按钮要选中 编辑) 然后点击执行。
- 从列表中选择一张表,输入它的坐标并保存。
Coordinates are relative; your diagram will be automatically scaled to fit
the page. When initially placing tables on the page, just pick any
coordinates -- say, 50x50. After clicking Save, you can then use the graphical editor to position the element correctly.
- When you'd like to look at your PDF, first be sure to click the Save button beneath the list
of tables and coordinates, to save any changes you made there. Then scroll
all the way down, select the PDF options you want, and click Go.
- Internet Explorer for Windows may suggest an incorrect filename when you try
to save a generated PDF. When
saving a generated PDF, be
sure that the filename ends in ".pdf", for example
"schema.pdf". Browsers on other operating systems, and other
browsers on Windows, do not have this problem.
No, it's MySQL that is doing silent column
type changing.
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.
It means "average".
结构:
- "添加 DROP TABLE" 将会添加一行告诉 MySQL,如果在导入时已存在这张表则 删除它。它不会在导出之后删除你的表,而仅作用于导入的目标。
- "If Not Exists" 将仅创建不存在的数据表。 否则,当有一个同名但结构不同的数据表存在时就会出错。
- "添加 AUTO_INCREMENT 值" 保证 AUTO_INCREMENT 值 (如果有) 将包含在备份中。
- "给表名和字段名加上反引号" 保护名称中含有特殊字符或保留字的字段和表。
- "Add into comments" includes column comments, relations, and MIME
types set in the pmadb in the dump as SQL comments (/* xxx */).
数据:
- "Complete inserts" adds the column names on every INSERT command,
for better documentation (but resulting file is bigger).
- "Extended inserts" provides a shorter dump file by using only once
the INSERT verb and the table name.
- "Delayed inserts" are best explained in the MySQL
manual.
- "Ignore inserts" treats errors as a warning instead. Again, more
info is provided in the MySQL manual, but
basically with this selected, invalid values are adjusted and inserted
rather than causing the entire statement to fail.
这是个馊主意,因为在 MySQL 的语法中 "数据库.表" 是一个常见的引用指定数据库中表的用法。更糟糕的是,MySQL
通常会允许你创建这样一个数据库,但是你无法使用它,甚至无法删除它。
要想使用 SQL 校验器,你需要 PHP 的 XML、PCRE 和 PEAR 扩展支持。 此外还需要 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 服务。
正确的方法是,首先添加不带索引的字段,然后显示表结构并使用 "创建索引" 对话框。在这个页面中,你就可以选择 BLOB
字段,并设置索引的大小,这是在 BLOB 字段上建立索引的条件。
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.
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?
你可以在显示查询结果的页面将你执行的任何查询保存为书签。通过按下页面底部写有 '将此查询加为书签' 字样的按钮。
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.
建立包含表的 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
这是因为你至少有下列全局权限之一: CREATE TEMPORARY TABLES 、 SHOW DATABASES 和 LOCK
TABLES。这些权限将允许用户看见所有的数据库名。 参见这个缺陷报告。
所以如果你的用户不需要这些权限,你可以撤销这些权限以使他们的数据库列表短些。
你需要正确设置两张表之间的关系,同时还要在外键表设置 "显示字段" 。参见 FAQ 6.6
中的例子。这时,如果外键表中有不超过 100 个值,就会出现一个下拉框。
你将会看到两个列表,第一个列表包含键和显示字段,第二个列表包含显示字段和键。这么做的目的是为了可以通过按下键或显示字段的首字母来定位。
若超过了 100 个值,将会使用新窗口,请浏览外键并选择。要修改默认 100 个值的限制,参见 $cfg['ForeignKeyMaxLimit'] 。
Yes. If a bookmark has the same label as a table name and it's not a public
bookmark, it will be executed.
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.
它们将在你进入该表的结构页面时自动并入。
要获得关于 MySQL BLOB 流的信息,请访问 blobstreaming.org 。你需要下列组件:
- MySQL 的 PBMS BLOB 流服务器 (0.5.15 或更高版本)
- MySQL 的 PBXT 存储引擎并开启流功能 (1.0.11-6 或更高版本)
- MySQL 的 PBMS 客户端库 (0.5.15 或更高版本)
- MySQL 的 PBMS PHP 扩展 (0.1.1 或更高版本)
以下是详细的配置和操作说明:
- config.inc.php 中的主机必须是一个 FQDN (完全合格域名) 而不是 "localhost" 。
- 确保你的目标表正在使用 PBXT 存储引擎并且有一个 LONGBLOB 类型的字段 (如果你想去除 BLOB
关系则必须可为空) 。
- 当上传或更新一条记录时,勾选 "上传到 BLOB 库" 复选框即可;否则,文件数据将被直接保存在你的 LONGBLOB 字段而不是
BLOB 库中。
- 最后在浏览数据表时,你会看到一个指向数据的链接,例如 "查看图像" 。若在上传时保存了正确的 MIME
类型,它将会被发送到你的浏览器。
先点击要选择的第一行,按住 Shift 键不放并点击最后一行。这在任何有行的地方都有效,例如浏览模式和结构页面。
在所有 phpMyAdmin 接受格式字符串的地方,你都可以使用扩展 @变量@ 和 strftime 格式字符串。扩展变量基于当前环境
(例如,在你没有选中任何数据表时,你就无法获取表名) ,可以使用下列变量:
@HTTP_HOST@
- 运行 phpMyAdmin 的 HTTP 主机
@SERVER@
- MySQL 服务器名
@VERBOSE@
- 在服务器设置中定义的详细的 MySQL 服务器名
@VSERVER@
- 如果设置了详细的 MySQL 服务器名则使用,否则使用常规的服务器名
@DATABASE@
- 当前打开的数据库
@TABLE@
- 当前打开的数据表
@COLUMNS@
- Columns of the currently opened table
@PHPMYADMIN@
- 带版本号的 phpMyAdmin 字样
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.
不是所有的表都能显示为图表。只有包含一个、两个或者三个字段的表才能通过图表表现出来。并且它还必须具有能令图表脚本理解的特定格式。当前所支持的格式可以在维基
(wiki) 中找到。
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:
-
Configure upload directory with $cfg['UploadDir'], upload both .shp and .dbf files
with the same filename and chose the .shp file from the import page.
-
Create a Zip archive with .shp and .dbf files and import it. For this to
work, you need to set $cfg['TempDir'] to a place where the web server user
can write (for example './tmp').
要在 UNIX 类系统下创建一个临时目录,可以通过:
cd phpMyAdmin
mkdir tmp
chmod o+rwx tmp
要选择关系,点击:
显示的字段为粉红色。要设置/取消显示的字段,点击“选择显示字段”图标,然后选择需要的字段名。
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 项目
我们的缺陷追踪器位于 http://sf.net/projects/phpmyadmin/
的 Bugs 功能块。
但请先和其他用户讨论你发现的问题:
https://sourceforge.net/projects/phpmyadmin/forums。
永远使用最新的 Git 版本的 po 文件来翻译。你也可以选择在我们的翻译服务器在线翻译,也可在此获得最新的 po 文件并与你的翻译合并。使用
po/phpmyadmin.pot 生成 po/语言代码.po 即可为你的语言创建新的翻译
(可以使用 msginit -i po/phpmyadmin.pot -l 语言代码 --no-translator -o
po/语言代码.po) 或通过邮件列表寻求在 web 界面上添加翻译。更多详细信息请见我们的维基。
请注意自从我们对文件定义了正确的编码后,我们尝试不在翻译中使用诸如 é 的 HTML 实体。 若使用 HTML
实体,JavaScript 消息中的文本将可能不能正确显示。 不论怎样有些实体还是必需的: 引号、不可分空格、& 符号、小于号、大于号。
然后你可以将你的翻译,或者打包压缩成 zip 文件来避免丢失特殊字符,放在 sourceforge.net 的翻译追踪器上。
你还可以订阅 phpMyAdmin
翻译 邮件列表,当我们有新文本需要翻译时就会在那发出通知。
文档是通过 po4a 和 gettext 翻译的 (参见文档查看现有的翻译) 。要开始翻译,先从
Git 检出 localized_docs/po,或者直接到翻译服务器在线翻译。如果没有找到你的语言,请联系
Michal Čihař;
他会加上。如果你更喜欢直接翻译 po 文件,请将翻译好的文件放在我们的翻译追踪器上。
对新开发者推荐以下方式:
- 通过匿名方式获取当前 git 库:
git clone
git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
- 添加你的内容
- 生成你的补丁: git diff > xxx.diff
- 通过 phpMyAdmin
项目的补丁追踪器提交你的补丁。
更多关于 git 的详细信息请见我们的维基。
库的写入权限仅授予给那些对 phpMyAdmin 作出大量贡献且富有经验的开发者。
同时,请看一下开发一节。
安全
请参见 http://www.phpmyadmin.net/home_page/security.php
如果你使用 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
然后你可以使用任何日志分析工具来检测潜在的攻击。
同步
你可以使用 phpMyAdmin
的同步功能同步数据库/表。该功能可以连接到本地或者远程服务器。但需要你输入服务器主机名、用户名、密码、端口和数据库名。然后你就可以在相同或不同的服务器间同步数据库了。
该功能对需要复制数据库结构和数据的开发者们是很有帮助的。此外,该功能并不仅限于复制,还能帮助用户保持他们的数据库和另一个数据库同步。除了可以同步整个数据库外,也可以只同步数据库的部分数据表。
你需要填写服务器的主机名、MySQL 中已存在的用户名和密码。端口默认是 3306 (MySQL
默认端口)。最后是数据库名。源数据库和目标数据库除了端口外的信息都要填写准确。
在成功通过认证阶段后,将会以表格形式显示出源和目标数据库中的数据表名。
在左侧会列出源数据库中的表。部分表的名字前会有一个 +
加号。表示这些表仅在源数据库中存在并且需要在同步到目标数据库时添加到目标数据库。名字前没有 + 加号的表已存在于目标数据库中。
在左侧会列出目标数据库中的表。部分表的名字后会有 (未找到)
字样。表示这些表将在与源数据库同步时添加到目标数据库。部分表的名字前会有一个 -
减号。表示这些表仅在目标数据库中存在并且不会被修改。位于中间的一列表示源/目标对应表之间的区别。
红色 S 和绿色 D 按钮表示结构 (S) 或数据 (D)
是否需要更新。当点击按钮时,它们将变成灰色,表示相应表将会被同步。
开发信息
phpMyAdmin 是开源的,我们欢迎您的参与。很多优秀的功能都不是我们写的,你同样可以帮助 phpMyAdmin 变成更加实用的工具。
如果您正打算贡献源代码,请阅读以下信息:
- 所有文件包括 libraries/header.inc.php (布局)、libraries/common.lib.php
(公共函数) 以及 config.inc.php 。
config.inc.php 中应只存放设置。请勿在其中加入其他代码。
公共函数应添加在 libraries/common.lib.php 中,特定功能的函数可以单独的函数库文件形式放在
libraries 子目录中。
- 您可以使用任何喜欢的格式书写代码。但请尽量保持代码简洁: 初学者经常使用 phpMyAdmin 作为范例来学习。
此外,我们希望能兼容 XHTML1.0 和 CSS2 并且符合 PEAR
代码标准。请尽量注意。
- 请通过
$cfg['Error_Handler']['display']
指令开启显示 PHP 错误和警告。
- 请尽量保持文件命名约定。数据表相关的用 tbl_*.php,数据库相关的用 db_*.php,服务器相关的用
server_*.php 等。
- 请使用 gettext 调用所有文本 (
__('文本') 或 _ngettext() 函数)。
若需要翻译,运行 scripts/update-po 脚本。要使用已翻译的文本,运行
scripts/generate-mo,即可生成 Gettext 所需的二进制文件。
- 如果您写一份更新记录,这将会更加有帮助。
-
phpMyAdmin 现在已经支持 DBG 扩展 (PHP 调试器 DBG
(外链,英语)) 以便开发者能更好地调试以及测试他们的代码。
更多信息请参见 $cfg['DBG']* 设置选项。
纪念哥伦比亚号航天飞机 (STS-107) 在重新进入地球大气层时爆炸以及为了地球人民牺牲的勇敢的人们。
版权
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
鸣谢
按时间先后顺序
- Tobias Ratschiller <tobias_at_ratschiller.com>
- phpmyadmin 项目创始人
- 1998 至 2000 年夏季的主要维护人
- Marc Delisle <marc_at_infomarc.info>
- multi-language version in December 1998
- 许多修正和改进
- SQL 分析器 (大部分)
- 目前的主要维护人
- Olivier Müller <om_at_omnis.ch>
- 于 2001 年 3 月在 SourceForge 启动 phpMyAdmin 项目
- 同步新功能和缺陷修正到不同的 CVS
- 改进多语言,动态语言选择
- 许多缺陷修正和改进
- Loïc Chapeaux <lolo_at_phpheaven.net>
- 重写并优化 javascript、DHTML 和 DOM
- 重写脚本使其符合 PEAR 代码标准以及 XHTML1.0 和 CSS2 规范
- 改进语言识别系统
- 许多缺陷修正和改进
- Robin Johnson <robbat2_at_users.sourceforge.net>
- 数据库维护功能
- 数据表类型代码
- 主机认证 IP 允许/禁止
- 基于数据库的配置 (未完成)
- SQL 解析器和语法高亮
- SQL 校验器
- 许多缺陷修正和改进
- Armel Fauveau <armel.fauveau_at_globalis-ms.com>
- 书签功能
- 多转储功能
- gzip 转储功能
- zip 转储功能
- Geert Lund <glund_at_silversoft.dk>
- 缺陷修正
- phpMyAdmin 早期在 phpwizard.net 的用户论坛版主
- Korakot Chaovavanich <korakot_at_iname.com>
- Pete Kelly <webmaster_at_trafficg.com>
- Steve Alberty <alberty_at_neptunlabs.de>
- 重写 PHP4 的转储代码
- MySQL 数据表统计
- 缺陷修正
- Benjamin Gandon <gandon_at_isia.cma.fr>
- Alexander M. Turek <me_at_derrabus.de>
- MySQL 4.0 / 4.1 / 5.0 兼容
- 抽象数据库接口 (PMA_DBI) 并支持 MySQLi
- 权限管理
- 导出为 XML
- 许多缺陷修正和改进
- 德语语言文件更新
- Mike Beck <mike.beck_at_web.de>
- 自动加入依例查询 (QBE)
- 打印预览中的字段链接
- 关系查看
- Michal Čihař <michal_at_cihar.com>
- 增强索引创建/显示功能
- 让 HTML 与 MySQL 使用不同的字符集
- 改进导出功能
- 许多缺陷修正和改进
- 捷克语语言文件更新
- Christophe Gesché 来自 "MySQL Form Generator for PHPMyAdmin"
(http://sf.net/projects/phpmysqlformgen/)
- Garvin Hicking <me_at_supergarv.de>
- 垂直显示记录补丁
- 基于 Javascript 的查询窗口 + SQL 历史功能
- 改进字段/数据库注释
- 类型转换
- 在左侧框架中使用自定义的数据库别名
- 数据表分层/分组显示
- 所见即所得版 PDF 关系的PDF 草稿板
- 新图标集
- 字段属性页的垂直显示模式
- 一些缺陷修正、功能、支持、德语语言增加
- Yukihiro Kawada <kawada_at_den.fujifilm.co.jp>
- Piotr Roszatycki <d3xter_at_users.sourceforge.net> 和 Dan Wilson
- Axel Sander <n8falke_at_users.sourceforge.net>
- Maxime Delorme <delorme.maxime_at_free.fr>
- Olof Edlund <olof.edlund_at_upright.se>
- Ivan R. Lanin <ivanlanin_at_users.sourceforge.net>
- phpMyAdmin logo (2004 年 6 月前)
- Mike Cochrane <mike_at_graftonhall.co.nz>
- Marcel Tschopp <ne0x_at_users.sourceforge.net>
- Nicola Asuni (Tecnick.com)
- Michael Keck <mkkeck_at_users.sourceforge.net>
- 重新设计 2.6.0
- phpMyAdmin 帆船 logo (2004 年 6 月)
- Mathias Landhäußer
- Representation at conferences
- Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
- Ivan A Kirillov
- Raj Kissu Rajandran (Google 代码之夏 2008)
- Piotr Przybylski (Google Summer of Code 2008, 2010 and 2011)
- 改进安装脚本
- 用户偏好
- Drizzle support
- Derek Schaefer (Google 代码之夏 2009)
- Alexander Rutkowski (Google 代码之夏 2009)
- Zahra Naeem (Google 代码之夏 2009)
- Tomáš Srnka (Google 代码之夏 2009)
- Muhammad Adnan (Google 代码之夏 2010)
- Lori Lee (Google 代码之夏 2010)
- 用户界面改进
- ENUM/SET 编辑器
- 简化导入/导出界面
- Ninad Pundalik (Google 代码之夏 2010)
- Martynas Mickevičius (Google 代码之夏 2010)
- Barrie Leslie
- Ankit Gupta (Google 代码之夏 2010)
- Rouslan Placella (Google Summer of Code 2011)
- Improved support for Stored Routines, Triggers and Events
- Italian translation updates
以及自 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 告诉我他不再开发他
(优秀) 的工具了。
在这里要感谢
- Amalesh Kempf <ak-lsml_at_living-source.com>
贡献了检查是否正在删除数据表或数据库的代码。同时他建议在 tbl_create.php3 中应该可以让用户设置主键。在 1.1.1 版本中他贡献了
ldi_*.php3-set (导入文本文件) 、缺陷报告以及许多小改进。
- Jan Legenhausen <jan_at_nrw.net>: 他对 1.3.0 中引进的功能作出许多改进
(包括诸如认证这样的重要功能)。他还增强了 1.4.1 中的数据表转储功能。以及缺陷修正及帮助。
- Marc Delisle <DelislMa_at_CollegeSherbrooke.qc.ca> 通过使用单独的语言文件使
phpMyAdmin 实现语言分离。他也对法语翻译作出了贡献。
- Alexandr Bravo <abravo_at_hq.admiral.ru> 贡献了
tbl_select.php3,可以只显示一张表中的某些字段的功能。
- Chris Jackson <chrisj_at_ctel.net> 在 tbl_change.php3 中添加了对 MySQL
函数的支持。在 2.0 中添加了 "依例查询" 功能。
- Dave Walton <walton_at_nordicdms.com> 添加了多服务器的支持并且经常贡献缺陷修正。
- Gabriel Ash <ga244_at_is8.nyu.edu> 贡献了 2.0.6 中的随机访问功能。
感谢下列对小的修改、改进、缺陷修正以及新语言支持作出贡献的人们:
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.
词汇表
源自维基百科,自由的百科全书