搜尋
首頁後端開發php教程PHPMyadmin配置文件详解(经典)

  1. $cfg['Servers'][$i]['user'] = 'root'; // MySQL user 访问phpmyadmin使用的mysql用户名
  2. fg['Servers'][$i]['password'] = ''; // MySQL password (only needed对应上述mysql用户名的密码
复制代码

D.认证方法 $cfg['Servers'][$i]['auth_type'] = 'cookie'; 在此有四种模式可供选择,cookie,http,HTTP,config config方式即输入phpmyadmin的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。 当该项设置为cookie,http或HTTP时,登录phpmyadmin需要数据用户名和密码进行验证,,具体如下: PHP安装模式为Apache,可以使用http和cookie; PHP安装模式为CGI,可以使用cookie

E.短语密码(blowfish_secret)的设置 $cfg['blowfish_secret'] = ''; 如果认证方法设置为cookie,就需要设置短语密码,置于设置为什么密码,由您自己决定 ,但是不能留空,否则会在登录phpmyadmin时提示错误 成功安装了phpmyadmin。

说明: 该文档说明的只是安装phpmyadmin的基本配置,关于config.default.php文件中各个配置参数的详细说明可以

以下是phpMyAdmin工具的安装方法。

一、下载 1、先到官方站点下载phpMyAdmin 安装包:http://www.phpmyadmin.net/ (安装包含各种语言all-languages) 2、再解压到 web 可以访问的目录下,如果是虚拟空间,可以解压后通过 ftp 工具上传到 web 目录下,同时您可以修改解压后该文件的名称(你可以自定义目录名称)。

二、配置 3、打开 /libraries/config.default.php文件(旧版本是根目录下的config.inc.php文件),用写字板(不要用记事本,这是UTF8编码)进行编辑,按照说明配置即可。 4、查找 $cfg['PmaAbsoluteUri']=‘'; // 修改为你将上传到空间的phpMyAdmin的网址 如:$cfg['PmaAbsoluteUri'] =‘http: // 网站域名/phpmyadmin/'; 5、查找 $cfg['Servers'][$i]['host'] =‘localhost'; // 通常用默认,也有例外,可以不用修改 6、查找 $cfg['Servers'][$i]['auth_type'] =‘config'; // 在自己的机子里调试用config;如果在网络上的空间用cookie. 在此有四种模式可供选择:cookie,http,HTTP,config ① config 方式即输入phpMyAdmin 的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。 ② 设置cookie,http,HTTP方式,登录 phpMyAdmin 需要数据用户名和密码进行验证。 具体如下:PHP 安装模式为 Apache,可以使用 http 和 cookie;PHP 安装模式为 CGI,可以使用 cookie。 7、查找 $cfg['Servers'][$i]['user'] = ‘root'; // MySQL用户名 8、查找 $cfg['Servers'][$i]['password'] =''; // MySQL 密码 (only needed 留空) 9、查找 $cfg['Servers'][$i]['only_db'] = ''; // 你只有一个数据就设置一下,设置为你的数据库名;如果你想架设服务器,那么建议留空 10、查找 $cfg['DefaultLang'] = ‘zh'; // 这里是选择语言,zh代表简体中文 11、查找$cfg['blowfish_secret'] =''; // 如果认证方法设置为cookie,就需要设置短语密码,设置为什么密码,由您自己决定,这里不能留空,否则会在登录 phpMyAdmin 时提示如下图所示的错误。 12、设置完毕后保存,现在可以上传到网络空间上了,浏览http://网站域名/phpmyadmin/测试一下。(输入数据库的用户名及密码就可以了)

如果要安装过程中出现:“phpMyAdmin - 错误 缺少 mysqli 扩展。请检查 PHP 配置。”错误。 解决方法如下: ①到phpmyadmin文件夹的\libraries\config.default.php文件中找:$cfg['Servers'][$i]['extension']='mysql';语句。 ②如果有找到$cfg['Servers'][$i]['extension']='mysql';这句,就继续查找下面这句$cfg['Servers'][$i]['extension']='mysqli'; 并把其的注释去掉。 ③如果没有找到$cfg['Servers'][$i]['extension']='mysql';这句,就把$cfg['Servers'][$i]['extension']='mysqli';语句,改成$cfg['Servers'][$i]['extension']='mysql'; 语句。(即确保 " mysql " 值能生效)

  1. /* $Id: config.inc.php,v 1.204.2.1 2003/10/10 14:24:24 nijel Exp $ */

  2. // vim: expandtab sw=4 ts=4 sts=4:
  3. /**

  4. * phpMyAdmin Configuration File
  5. *
  6. * All directives are explained in Documentation.html
  7. */
  8. /**

  9. * Sets the php error reporting - Please do not change this line!
  10. */
  11. if (!isset($old_error_reporting)) {
  12. error_reporting(E_ALL);
  13. @ini_set('display_errors', '1');
  14. }
  15. /**

  16. * Your phpMyAdmin url
  17. *
  18. * Complete the variable below with the full url ie
  19. * http://www.your_web.net/path_to_your_phpMyAdmin_directory/
  20. *
  21. * It must contain characters that are valid for a URL, and the path is
  22. * case sensitive on some Web servers, for example Unix-based servers.
  23. *
  24. * In most cases you can leave this variable empty, as the correct value
  25. * will be detected automatically. However, we recommend that you do
  26. * test to see that the auto-detection code works in your system. A good
  27. * test is to browse a table, then edit a row and save it. There will be
  28. * an error message if phpMyAdmin cannot auto-detect the correct value.
  29. *
  30. * If the auto-detection code does work properly, you can set to TRUE the
  31. * $cfg['PmaAbsoluteUri_DisableWarning'] variable below.
  32. */
  33. $cfg['PmaAbsoluteUri'] = '';-----这里设置你的phpmyadmin的URL,如:http://localhost/phpmyadmin/
  34. /**

  35. * Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
  36. * You should use this if and ONLY if the PmaAbsoluteUri auto-detection
  37. * works perfectly.
  38. */
  39. $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
  40. /**

  41. * Disable the default warning that is displayed on the DB Details Structure page if
  42. * any of the required Tables for the relationfeatures could not be found
  43. */
  44. $cfg['PmaNoRelation_DisableWarning'] = FALSE;
  45. /**

  46. * The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
  47. * at least one server configuration uses 'cookie' auth_type, enter here a
  48. * passphrase that will be used by blowfish.
  49. $cfg['blowfish_secret'] = '';-----设定好root密码后这里也要填写
  50. /**

  51. * Server(s) configuration
  52. */
  53. $i = 0;
  54. // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
  55. // You can disable a server config entry by setting host to ''.
  56. $i++;
  57. $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address----这里可以设定远程MySQL服务器IP地址
  58. $cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port-----默认为3306

  59. $cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket

  60. $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')-----连接MySQL服务器的方式

  61. $cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection

  62. // (requires PHP >= 4.3.0)-----是否使用压缩协议,PHP版本须>= 4.3.0
  63. $cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings

  64. // (this user must have read-only
  65. $cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
  66. // and "mysql/db" tables)-----MySQL控制用户设定,该用户只对mysql数据库下的user和db表有完全权限
  67. $cfg['Servers'][$i]['auth_type'] = 'config';

  68. // Authentication method (config, http or cookie based)?-----如果PHP安装模式为Apache,可以使用http和cookie;如果PHP安装模式为CGI,可以使用cookie;默认为config,是不安全的,不推荐。
  69. $cfg['Servers'][$i]['user'] = 'root'; // MySQL user-----MySQL连接用户

  70. $cfg['Servers'][$i]['password'] = '';

  71. // MySQL password (only needed with 'config' auth_type)-----MySQL连接密码,建议在安装好PHP和MySQL后,先用phpmyadmin设定root密码,然后在这里填写
  72. $cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only

  73. // this db is displayed
  74. // at left frame
  75. // It may also be an array
  76. // of db-names-----如果在这里设定一个数据库的名字,那么登陆后框架左边将只显示这个数据库
  77. $cfg['Servers'][$i]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname

  78. $cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features

  79. // (see scripts/create_tables.sql)
  80. // - leave blank for no support
  81. // DEFAULT: 'phpmyadmin'
  82. $cfg['Servers'][$i]['bookmarktable'] = ''; // Bookmark table
  83. // - leave blank for no bookmark support
  84. // DEFAULT: 'pma_bookmark'
  85. $cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
  86. // - leave blank for no relation-links support
  87. // DEFAULT: 'pma_relation'
  88. $cfg['Servers'][$i]['table_info'] = ''; // table to describe the display fields
  89. // - leave blank for no display fields support
  90. // DEFAULT: 'pma_table_info'
  91. $cfg['Servers'][$i]['table_coords'] = ''; // table to describe the tables position for the PDF schema
  92. // - leave blank for no PDF schema support
  93. // DEFAULT: 'pma_table_coords'
  94. $cfg['Servers'][$i]['pdf_pages'] = ''; // table to describe pages of relationpdf
  95. // - leave blank if you don't want to use this
  96. // DEFAULT: 'pma_pdf_pages'
  97. $cfg['Servers'][$i]['column_info'] = ''; // table to store column information
  98. // - leave blank for no column comments/mime types
  99. // DEFAULT: 'pma_column_info'
  100. $cfg['Servers'][$i]['history'] = ''; // table to store SQL history
  101. // - leave blank for no SQL query history
  102. // DEFAULT: 'pma_history'
  103. $cfg['Servers'][$i]['verbose_check'] = TRUE; // set to FALSE if you know that your pma_* tables
  104. // are up to date. This prevents compatibility
  105. // checks and thereby increases performance.
  106. $cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
  107. = '';
  108. $cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
  109. = array();
  110. $i++;

  111. $cfg['Servers'][$i]['host'] = '';
  112. $cfg['Servers'][$i]['port'] = '';
  113. $cfg['Servers'][$i]['socket'] = '';
  114. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  115. $cfg['Servers'][$i]['compress'] = FALSE;
  116. $cfg['Servers'][$i]['controluser'] = '';
  117. $cfg['Servers'][$i]['controlpass'] = '';
  118. $cfg['Servers'][$i]['auth_type'] = 'config';
  119. $cfg['Servers'][$i]['user'] = 'root';
  120. $cfg['Servers'][$i]['password'] = '';
  121. $cfg['Servers'][$i]['only_db'] = '';
  122. $cfg['Servers'][$i]['verbose'] = '';
  123. $cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
  124. $cfg['Servers'][$i]['bookmarktable'] = ''; // 'pma_bookmark'
  125. $cfg['Servers'][$i]['relation'] = ''; // 'pma_relation'
  126. $cfg['Servers'][$i]['table_info'] = ''; // 'pma_table_info'
  127. $cfg['Servers'][$i]['table_coords'] = ''; // 'pma_table_coords'
  128. $cfg['Servers'][$i]['pdf_pages'] = ''; // 'pma_pdf_pages'
  129. $cfg['Servers'][$i]['column_info'] = ''; // 'pma_column_info'
  130. $cfg['Servers'][$i]['history'] = ''; // 'pma_history'
  131. $cfg['Servers'][$i]['verbose_check'] = TRUE;
  132. $cfg['Servers'][$i]['AllowDeny']['order']
  133. = '';
  134. $cfg['Servers'][$i]['AllowDeny']['rules']
  135. = array();
  136. $i++;

  137. $cfg['Servers'][$i]['host'] = '';
  138. $cfg['Servers'][$i]['port'] = '';
  139. $cfg['Servers'][$i]['socket'] = '';
  140. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  141. $cfg['Servers'][$i]['compress'] = FALSE;
  142. $cfg['Servers'][$i]['controluser'] = '';
  143. $cfg['Servers'][$i]['controlpass'] = '';
  144. $cfg['Servers'][$i]['auth_type'] = 'config';
  145. $cfg['Servers'][$i]['user'] = 'root';
  146. $cfg['Servers'][$i]['password'] = '';
  147. $cfg['Servers'][$i]['only_db'] = '';
  148. $cfg['Servers'][$i]['verbose'] = '';
  149. $cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
  150. $cfg['Servers'][$i]['bookmarktable'] = ''; // 'pma_bookmark'
  151. $cfg['Servers'][$i]['relation'] = ''; // 'pma_relation'
  152. $cfg['Servers'][$i]['table_info'] = ''; // 'pma_table_info'
  153. $cfg['Servers'][$i]['table_coords'] = ''; // 'pma_table_coords'
  154. $cfg['Servers'][$i]['pdf_pages'] = ''; // 'pma_pdf_pages'
  155. $cfg['Servers'][$i]['column_info'] = ''; // 'pma_column_info'
  156. $cfg['Servers'][$i]['history'] = ''; // 'pma_history'
  157. $cfg['Servers'][$i]['verbose_check'] = TRUE;
  158. $cfg['Servers'][$i]['AllowDeny']['order']
  159. = '';
  160. $cfg['Servers'][$i]['AllowDeny']['rules']
  161. = array();
  162. // If you have more than one server configured, you can set $cfg['ServerDefault']

  163. // to any one of them to autoconnect to that server when phpMyAdmin is started,
  164. // or set it to 0 to be given a list of servers without logging in
  165. // If you have only one server configured, $cfg['ServerDefault'] *MUST* be
  166. // set to that server.[color]=red]-----是否显示所有的MySQL服务器
  167. $cfg['ServerDefault'] = 1; // Default server (0 = no default server)
  168. $cfg['Server'] = '';
  169. unset($cfg['Servers'][0]);
  170. /**

  171. * Other core phpMyAdmin settings
  172. */
  173. $cfg['OBGzip'] = 'auto'; // use GZIP output buffering if possible (TRUE|FALSE|'auto')-----有必要的话是否使用GZIP输出缓冲
  174. $cfg['PersistentConnections'] = FALSE; // use persistent connections to MySQL database-----是否使用MySQL持久连接,即pconnect

  175. $cfg['ExecTimeLimit'] = 300; // maximum execution time in seconds (0 for no limit)-----最大脚本执行时间,单位:秒

  176. $cfg['SkipLockedTables'] = FALSE; // mark used tables, make possible to show

  177. // locked tables (since MySQL 3.23.30)
  178. $cfg['ShowSQL'] = TRUE; // show SQL queries as run-----运行查询时显示SQL查询语句
  179. $cfg['AllowUserDropDatabase'] = FALSE; // show a 'Drop database' link to normal users-----是否对普通用户显示“删除数据库”连接

  180. $cfg['Confirm'] = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'-----删除数据表/库前是否出现确认提示框

  181. $cfg['LoginCookieRecall'] = TRUE; // recall previous login in cookie auth. mode or not-----是否收回先前cookie认证模式的cookie

  182. $cfg['UseDbSearch'] = TRUE; // whether to enable the "database search" feature

  183. // or not
  184. $cfg['IgnoreMultiSubmitErrors'] = FALSE; // if set to true, PMA continues computing multiple-statement queries
  185. // even if one of the queries failed
  186. $cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the affected rows of EACH statement on
  187. // multiple-statement queries. See the read_dump.php file for hardcoded
  188. // defaults on how many queries a statement may contain!
  189. $cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth
复制代码


陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
PHP的目的:構建動態網站PHP的目的:構建動態網站Apr 15, 2025 am 12:18 AM

PHP用於構建動態網站,其核心功能包括:1.生成動態內容,通過與數據庫對接實時生成網頁;2.處理用戶交互和表單提交,驗證輸入並響應操作;3.管理會話和用戶認證,提供個性化體驗;4.優化性能和遵循最佳實踐,提升網站效率和安全性。

PHP:處理數據庫和服務器端邏輯PHP:處理數據庫和服務器端邏輯Apr 15, 2025 am 12:15 AM

PHP在數據庫操作和服務器端邏輯處理中使用MySQLi和PDO擴展進行數據庫交互,並通過會話管理等功能處理服務器端邏輯。 1)使用MySQLi或PDO連接數據庫,執行SQL查詢。 2)通過會話管理等功能處理HTTP請求和用戶狀態。 3)使用事務確保數據庫操作的原子性。 4)防止SQL注入,使用異常處理和關閉連接來調試。 5)通過索引和緩存優化性能,編寫可讀性高的代碼並進行錯誤處理。

您如何防止PHP中的SQL注入? (準備的陳述,PDO)您如何防止PHP中的SQL注入? (準備的陳述,PDO)Apr 15, 2025 am 12:15 AM

在PHP中使用預處理語句和PDO可以有效防範SQL注入攻擊。 1)使用PDO連接數據庫並設置錯誤模式。 2)通過prepare方法創建預處理語句,使用佔位符和execute方法傳遞數據。 3)處理查詢結果並確保代碼的安全性和性能。

PHP和Python:代碼示例和比較PHP和Python:代碼示例和比較Apr 15, 2025 am 12:07 AM

PHP和Python各有優劣,選擇取決於項目需求和個人偏好。 1.PHP適合快速開發和維護大型Web應用。 2.Python在數據科學和機器學習領域佔據主導地位。

PHP行動:現實世界中的示例和應用程序PHP行動:現實世界中的示例和應用程序Apr 14, 2025 am 12:19 AM

PHP在電子商務、內容管理系統和API開發中廣泛應用。 1)電子商務:用於購物車功能和支付處理。 2)內容管理系統:用於動態內容生成和用戶管理。 3)API開發:用於RESTfulAPI開發和API安全性。通過性能優化和最佳實踐,PHP應用的效率和可維護性得以提升。

PHP:輕鬆創建交互式Web內容PHP:輕鬆創建交互式Web內容Apr 14, 2025 am 12:15 AM

PHP可以輕鬆創建互動網頁內容。 1)通過嵌入HTML動態生成內容,根據用戶輸入或數據庫數據實時展示。 2)處理表單提交並生成動態輸出,確保使用htmlspecialchars防XSS。 3)結合MySQL創建用戶註冊系統,使用password_hash和預處理語句增強安全性。掌握這些技巧將提升Web開發效率。

PHP和Python:比較兩種流行的編程語言PHP和Python:比較兩種流行的編程語言Apr 14, 2025 am 12:13 AM

PHP和Python各有優勢,選擇依據項目需求。 1.PHP適合web開發,尤其快速開發和維護網站。 2.Python適用於數據科學、機器學習和人工智能,語法簡潔,適合初學者。

PHP的持久相關性:它還活著嗎?PHP的持久相關性:它還活著嗎?Apr 14, 2025 am 12:12 AM

PHP仍然具有活力,其在現代編程領域中依然佔據重要地位。 1)PHP的簡單易學和強大社區支持使其在Web開發中廣泛應用;2)其靈活性和穩定性使其在處理Web表單、數據庫操作和文件處理等方面表現出色;3)PHP不斷進化和優化,適用於初學者和經驗豐富的開發者。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
4 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
4 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
4 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
1 個月前By尊渡假赌尊渡假赌尊渡假赌

熱工具

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

Atom編輯器mac版下載

Atom編輯器mac版下載

最受歡迎的的開源編輯器

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能