Phpmyadmin configuration file DETAILS phpmyadmin configuration method

Source: Internet
Author: User
Tags http authentication php mysql extension

How can I configure the phpmyadmin configuration file? I believe there are many friends who are not clear about it, especially those who are getting started. Let's share the phpmyadmin configuration file with you in the help house editor. If you need it, add it to your favorites!

Phpmyadmin configuration file:

Note: For Mac users, PHP seems to dislike Apple's line feed symbol ("\ r"). Therefore, before saving the configuration file, make sure that your text editor can use * nix line breaks ("\ n ").

Configuration prompt: almost all configuration parameters are in the config. inc. php file.

If this file does not exist, you can find config. default. php In the libraries directory,

Copy it to the root directory and rename it config. inc. php.

Parameters related to interface design (such as color) are stored in the themes/themename/layout. inc. php file.

You can also create the config. footer. inc. php file and config. header. inc. php file to add custom code for your site, which is displayed in the header and footer.

$ Cfg [PmaAbsoluteUri] string

Enter the complete URL of your phpMyAdmin installation directory (including the complete path ).

Example: http://www.your _ web.net/path_to_your_phpmyadmin_directory /.

Note: In Some browsers, URLs are case sensitive. Do not forget the backslash at the end.

From version 2.3.0, you can try not to enter this parameter. PhpMyAdmin can automatically detect the correct configuration.

Users who use port redirection must enter PmaAbsoluteUri (If your server is behind the firewall, phpMyAdmin cannot load graphics and style sheets ).

The check method is to browse a table, edit a record, and save it. If phpMyAdmin cannot detect the correct value, the system will prompt an error.

If you see an error message, you must manually set this parameter. If you have other questions, submit them to our bug tracker system. We will improve the code in the future.

$ Cfg [PmaNoRelation_DisableWarning] Boolean

PhpMyAdmin provides support for primary and external data tables (For details, refer to the $ cfg ['servers'] [$ I] ['pmadb'] parameter ).

If you cannot use these functions, refer to the "Structure" page of a database. There will be a connection, which will analyze the reasons for these features being disabled for you.

If you do not want to use these functions, set this parameter to TRUE, and this information will not be displayed.

$ Cfg [blowfish_secret] string

Since version 2.5.2, the "cookie" authentication method uses the blowfish algorithm to encrypt passwords.

If you use the "cookie" authentication method, enter a random key here, which is used inside the blowfish algorithm:

You are not prompted to enter it during use. The maximum length of a CMK is 46 characters.

$ Cfg [Servers] Array

From version 1.4.2, phpMyAdmin can manage multiple MySQL servers.

Therefore, the $ cfg ['servers'] parameter is added, which is an array containing login information of different Servers.

The first $ cfg ['servers'] [$ I] ['host'] parameter is the host name of the first server, the second $ cfg ['servers'] [$ I] ['host'] parameter is the host name of the second server, and so on.

In libraries/config. default. in the php file, only the first server is defined, but you can still. inc. php adds more servers by itself, copies the entire block, or the required part (you do not need to define all values, but only those parameters you have modified ).

$ Cfg ['servers'] [$ I] ['host'] string

The host name or IP address of server I, for example, localhost.

$ Cfg ['servers'] [$ I] ['Port'] string

The Port Number of the server I. The default value is 3306 (optional ).

If your host name is "localhost", MySQL will ignore the port number and connect it as a socket.

Therefore, if you need to connect to a different port number, enter "127.0.0.1" or a real host name in $ cfg ['servers'] [$ I] ['host.

$ Cfg ['servers'] [$ I] ['sockets '] string

Socket path. If this parameter is left blank, the default value is used.

$ Cfg ['servers'] [$ I] ['connect _ type'] string

The connection method to the MySQL server. You can select "socket" or "tcp ".

The default value is "tcp". This method can connect almost all MySQL servers, while the sockets method does not support some platforms.

To use the socket method, your MySQL server must be in the same server as the Web server.

$ Cfg ['servers'] [$ I] ['extension'] string

Php MySQL extension used by the phpMyAdmin system:

Mysql: Classic MySQL extension. Default Value and recommended for MySQL 4.0 users.

Mysqli: improved MySQL extension. It is included in php 5.0.0 and later versions and is recommended for MySQL 4.1.0 and later versions.

$ Cfg ['servers'] [$ I] ['compus'] Boolean

Whether to use the compression protocol to connect to the MySQL server.

This function requires PHP 4.3.0 or later.

$ Cfg ['servers'] [$ I] ['controluser'] string

$ Cfg ['servers'] [$ I] ['controlpass'] string

This special account has two special functions: Yes, some related functions are available (refer to the $ cfg ['servers'] [$ I] ['pmadb'] parameter );

On a MySQL Server earlier than version 4.1.2 or the MySQL server opened with the -- skip-show-database parameter, enable the Multi-User Function (http or cookie Authentication mode is required ).

If you use the HTTP or cookie Authentication Mode (or use the "config" Authentication Mode in phpMyAdmin 2.2.1 or later versions), you need to set up a MySQL account, which has only the SELECT permission for the following table:

Mysql. user table (all fields except the "Password" field ),

Mysql. db table (all fields ),

Mysql. tables_priv table (all fields except the "Grantor" and "Timestamp" fields ).

This account is used to detect databases that can be viewed by login users.

For more information, see "Using authentication modes" in the installation section of this document.

PhpMyAdmin earlier than version 2.2.5. this parameter is called "stduser/stdpass ".

$ Cfg ['servers'] [$ I] ['auth _ type'] string ['http' | 'cooker' | 'config']

Select config, cookie, or http authentication.

* 'Config' authentication ($ auth_type = 'config') is the simplest mode. The user name and password are stored in the config. inc. php file;

* 'Cookies' Authentication Mode ($ auth_type = 'cookies') 2.2.3 or later versions allow you to log on to MySQL using cookies as any valid MySQL user.

The user name and password are stored in the cookie. After cancellation, the password will be deleted. You can also log on to any server (you need to enable the $ cfg ['allowarbitraryserver'] parameter ).

* 'Http' authentication (in earlier versions, it is called 'advanced ') ($ auth_type = 'http') 1.3.0 or later allows you to log on with http-Auth as any valid MySQL user.

For more information, see "Using authentication modes" in the installation section of this document.

$ Cfg ['servers'] [$ I] ['user'] string

$ Cfg ['servers'] [$ I] ['Password'] string

If auth_type = 'config', phpMyAdmin uses this account to connect to the MySQL server.

If you use HTTP or cookie authentication, do not enter this account.

$ Cfg ['servers'] [$ I] ['only _ db'] string or Array

If you enter a database (or a group of databases), the logged-on user will only see this (or these) database.

Starting from phpMyAdmin 2.2.1, the database name can use the MySQL wildcard ("_" and "% "):

Use a slash to distinguish the two symbols. For example, use 'my \ _ db' instead of 'my _ db '.

This function can effectively reduce server load. MySQL server will not create a list of available databases.

However, this function does not overwrite the permission rules of the MySQL server. setting this parameter only indicates that only these databases are displayed, and not all displayed databases can be accessed.

Example of multiple databases

Code

$ Cfg ['servers'] [$ I] ['only _ db'] = array ('db1', 'db2 ');

From phpMyAdmin 2.5.5, the sequence in the array will be used as the database display sequence for the left frame of the page. Therefore, you can arrange your own databases.

If you only want to display several databases at the beginning of the list, regardless of other databases, you do not need to specify all databases.

You only need to enter:

Code

$ Cfg ['servers'] [$ I] ['only _ db'] = array ('db3', 'db4 ','*');

PhpMyAdmin displays db3 and db4 at the beginning, and the others are arranged in the default order.

$ Cfg ['servers'] [$ I] ['hide _ db'] string

Used to hide regular expressions of some databases. These databases are not displayed in the list, and users can still access them.

$ Cfg ['servers'] [$ I] ['verbo'] string

Valid only when the multi-server mode is used. After setting, this string is displayed in the drop-down menu of the home page instead of the host name.

$ Cfg ['servers'] [$ I] ['pmadb'] string

Name of the database that contains the connected table structure.

For more information, see the Linked-tables infrastructure Section.

If you are the only user of phpMyAdmin, you can use your current database to store the special data and enter the current database name.

If your phpMyAdmin configuration is used by multiple users, enter the name of the central database containing the connection table structure.

$ Cfg ['servers'] [$ I] ['bookmarktable'] string

PhpMyAdmin allows you to store frequently used queries in bookmarks starting with version 2.2.0.

How to enable this function:

* Set the pmadb and connection table structure

* Enter the table name in $ cfg ['servers'] [$ I] ['bookmarktable '].

----------------------------------

Common configuration methods:

To install and configure phpMyAdmin, follow these steps:

First, let's talk about the configuration of the PHP environment:

It is best to copy all the DLL files in the PHP installation directory to C: \ WINDOWS \ system32 to solve the above problems.

A. First download the phpMyAdmin installation package:

To foreign official website http://www.phpmyadmin.net, click the navigation bar on the downloads Downloads page, select “all-languages.zip version downloaded to the local, unzip. Place the decompressed file in the virtual directory specified by the system (the folder name can be customized). For example, the storage location of your machine is D: \ SERVER \ phpMyAdmin3201.

B. Find the "/libraries/config. default. php" file, copy it to the root directory, and rename "config. inc. php ". Open and edit with a tablet that supports UTF-8 encoding.

C. Find "$ cfg ['pmaabsoluteuri ']" and modify the URL of phpMyAdmin to be uploaded to the space:

Here, because I am local debugging, I changed:

$ Cfg ['pmaabsoluteuri '] = 'HTTP: // localhost/phpmyadmin /';

Note: Do not miss the last backslash (/) and http at the beginning.

D. Search for the string "$ cfg ['servers'] [$ I] ['host']" and set its value to "localhost ".

$ Cfg ['servers'] [$ I] ['host'] = 'localhost ';

(The default value is usually used, and there are exceptions. You do not need to modify the value)

E. Search for the string "$ cfg ['servers'] [$ I] ['auth _ type']". The default value is "config", which is generally used for local debugging, there are some security risks. We recommend that you set the value to "cookie ".

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';

My personal suggestion: both on the local network and on the network, we recommend that you set the cookie to be the first in security.

At the same time, when the auth_type value is set to cookie, there is also a need to make the appropriate changes:

$ Cfg ['blowfish _ secret'] = '';

Changed:

$ Cfg ['blowfish _ secret'] = 'abcdefg ';

This variable sets the cookie encryption key, which can be up to 46 characters in length. If this field is left blank, the above 2nd error will occur: "the configuration file now requires a top secret phrase password (blowfish_secret )".

F. Search for the string "$ cfg ['servers'] [$ I] ['user']" and set the value to the MySQL System "root" user name.

$ Cfg ['servers'] [$ I] ['user'] = 'root'; // MySQL user

(Username: Use root on your own machine. It is generally your ftp Username on the Internet, which the VM provider will tell you. Do not change it)

G. Search for the string "$ cfg ['servers'] [$ I] ['Password']" and set the value to MySQL System "root" User password "123456 ".

$ Cfg ['servers'] [$ I] ['Password'] = '000000'; // MySQL password

(123456 change to the user password used to connect to your MYSQL database)

H. Search for the string "$ cfg ['defaultlang ']" and set its value to "zh ".

$ Cfg ['defaultlang '] = 'zh ';

(Select the language. "zh" indicates the meaning of Simplified Chinese)

I. Search for the string "$ cfg ['defaultcharset']" and set its value to "gb2312 ".

$ Cfg ['defaultcharset'] = 'gb2312 ';

(Modify the default encoding to the Chinese mark)

Now, phpMyAdmin has been configured. You can open http: // localhost/phpMyAdmin_URL/to access the convenient and convenient graphical management software phpMyAdmin.

For other options in the configuration file not mentioned in this article, you do not need to care about or modify them.

Small editor for helping customers guess you are still good:

How to open the PHP file? How to open a PHP File

PHP beginners must take a look at the Tutorial: PHP programming principles that PHP programmers must follow

PhpMyAdmin (Remote Control database software) v4.2.1 Chinese Version

Rating:

Category: Remote Control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.