PHPMyadmin設定檔詳解(經典)

來源:互聯網
上載者:User
  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

複製代碼
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.