Home  >  Article  >  Backend Development  >  Detailed explanation of PHPMyadmin configuration file (classic)

Detailed explanation of PHPMyadmin configuration file (classic)

WBOY
WBOYOriginal
2016-07-25 08:55:22853browse
  1. $cfg['Servers'][$i]['user'] = 'root'; // MySQL user accesses the mysql user name used by phpmyadmin
  2. fg['Servers'][$i][' password'] = ''; // MySQL password (only neededThe password corresponding to the above mysql user name
Copy code

D.Authentication method $cfg['Servers'][$i]['auth_type'] = 'cookie'; There are four modes to choose from here, cookie, http, HTTP, config The config method is to enter the access URL of phpmyadmin to enter directly without entering the user name and password. It is unsafe and not recommended. When this item is set to cookie, http or HTTP, logging in to phpmyadmin requires a data username and password for verification, as follows: PHP installation mode is Apache, which can use http and cookies; PHP installation mode is CGI, cookies can be used

E. Setting of phrase password (blowfish_secret) $cfg['blowfish_secret'] = ''; If the authentication method is set to cookie, you need to set a phrase password. It is up to you to decide what password to set, but it cannot be left blank, otherwise an error will be prompted when logging in to phpmyadmin. Installed phpmyadmin successfully.

Instructions: This document only describes the basic configuration of installing phpmyadmin. Detailed descriptions of each configuration parameter in the config.default.php file can be found

The following is how to install the phpMyAdmin tool.

1. Download 1. First go to the official website to download the phpMyAdmin installation package: http://www.phpmyadmin.net/ (the installation includes all-languages) 2. Unzip it to a directory that can be accessed by the web. If it is a virtual space, you can decompress it and upload it to the web directory through the ftp tool. At the same time, you can modify the name of the decompressed file (you can customize the directory name).

2. Configuration 3. Open the /libraries/config.default.php file (the old version is the config.inc.php file in the root directory), edit it with WordPad (do not use Notepad, this is UTF8 encoding), and configure it according to the instructions. . 4. Find $cfg['PmaAbsoluteUri']=''; // Change it to the URL of phpMyAdmin that you will upload to the space. For example: $cfg['PmaAbsoluteUri'] ='http: //Website domain name/phpmyadmin/'; 5. Search $cfg['Servers'][$i]['host'] ='localhost'; //Usually use the default, there are exceptions, you don't need to modify it. 6. Find $cfg['Servers'][$i]['auth_type'] ='config'; // Use config for debugging on your own machine; if you are on the network, use cookies. There are four modes to choose from: cookie, http, HTTP, config ① The config method is to enter the access URL of phpMyAdmin to enter directly without entering the user name and password. It is unsafe and not recommended. ② Set cookie, http, HTTP method, and log in to phpMyAdmin. User name and password are required for verification. The details are as follows: PHP installation mode is Apache, and http and cookies can be used; PHP installation mode is CGI, and cookies can be used. 7. Find $cfg['Servers'][$i]['user'] = 'root'; // MySQL user name 8. Find $cfg['Servers'][$i]['password'] =''; // MySQL password (only needed, leave blank) 9. Find $cfg['Servers'][$i]['only_db'] = ''; // If you only have one data, set it to your database name; if you want to set up a server, it is recommended to leave it blank. 10. Search $cfg['DefaultLang'] = 'zh'; // Here is the language selection, zh represents Simplified Chinese 11. Find $cfg['blowfish_secret'] =''; // If the authentication method is set to cookie, you need to set a phrase password. It is up to you to decide what password to set. You cannot leave it blank here, otherwise you will be prompted when logging in to phpMyAdmin. The error is shown in the picture below. 12. Save after setting up. Now you can upload it to the network space. Browse http://website domain name/phpmyadmin/ to test it. (Just enter the username and password of the database)

If you want to install: "phpMyAdmin - Error The mysqli extension is missing. Please check the PHP configuration." error. The solution is as follows: ①Go to the librariesconfig.default.php file in the phpmyadmin folder and find: $cfg['Servers'][$i]['extension']='mysql'; statement. ② If you find the sentence $cfg['Servers'][$i]['extension']='mysql';, continue to search for the following sentence $cfg['Servers'][$i]['extension'] ='mysqli'; and remove its comments. ③If the sentence $cfg['Servers'][$i]['extension']='mysql'; is not found, replace $cfg['Servers'][$i]['extension']='mysqli' ; statement, change it to $cfg['Servers'][$i]['extension']='mysql'; statement. (That is, ensure that the " mysql " value can take effect)

  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 connection user

  70. < ;p>$cfg['Servers'][$i]['password'] = '';
  71. // MySQL password (only needed with 'config' auth_type)-----MySQL connection password, it is recommended to install it before After PHP and MySQL, first use phpmyadmin to set the root password, and then fill in

  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-----If you set a database here name, then only this database will be displayed on the left side of the frame after logging in

  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();< /p>
  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

复制代码


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn