Error solution for XAMPP accessing phpmyadmin

Source: Internet
Author: User
Tags auth mysql host phpmyadmin server port

MySQL has a default dedicated port: 3306. Therefore, if you have installed MySQL independently, Port 3306 is occupied. When installing MySQL integrated with XAMPP, you must reset the independent port. Otherwise, you cannot access phpmyadmin. The error message I receive is shown in the following figure:

The modification method is also very convenient. Open the control panel of XAMPP, find the config on the right side of mysql, and click it. The "my. ini" option appears. This is the mysql configuration file, as shown in the figure:

Of course, it's just a port change. I still cannot access it. You also need to modify the phpmyadmin configuration file. There are two ways:

I. Solutions to access phpmyadmin errors

1. Open the xampp Directory (the default installation directory), open the phpmyadmin directory, and find config. inc. php, my default configuration:

The code is as follows: Copy code

<? Php
/*
* This is needed for cookie based authentication to encrypt password in
* Cookie
*/
$ Cfg ['blowfish _ secret'] = 'xampp ';/* YOU shoshould change this for a more secure cookie auth! */

/*
* Servers configuration
*/
$ I = 0;

/*
* First server
*/
$ I ++;

/* Authentication type and info */
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
$ Cfg ['servers'] [$ I] ['user'] = 'username'; // mysql username
$ Cfg ['servers'] [$ I] ['password'] = 'password'; // mysql password
$ Cfg ['servers'] [$ I] ['extension'] = 'mysqli'; // extended configuration. If an error such as mysqli is not configured during access, add this parameter. Yes by default
$ Cfg ['servers'] [$ I] ['allownopassword'] = true;
$ Cfg ['Lang '] = '';

/* Bind to the localhost ipv4 address and tcp */
$ Cfg ['servers'] [$ I] ['host'] = '2017. 0.0.1 ';
$ Cfg ['servers'] [$ I] ['connect _ type'] = 'tcp ';

/* User for advanced features */
$ Cfg ['servers'] [$ I] ['controluser'] = 'PMA ';
$ Cfg ['servers'] [$ I] ['controlpass'] = '';

/* Advanced phpMyAdmin features */
$ Cfg ['servers'] [$ I] ['pmadb'] = 'phpmyadmin ';
$ Cfg ['servers'] [$ I] ['bookmarktable'] = 'PMA _ bookmark ';
$ Cfg ['servers'] [$ I] ['relation'] = 'PMA _ relation ';
$ Cfg ['servers'] [$ I] ['Table _ info'] = 'PMA _ table_info ';
$ Cfg ['servers'] [$ I] ['Table _ coords '] = 'PMA _ table_coords ';
$ Cfg ['servers'] [$ I] ['PDF _ page'] = 'PMA _ pdf_pages ';
$ Cfg ['servers'] [$ I] ['column _ info'] = 'PMA _ column_info ';
$ Cfg ['servers'] [$ I] ['History '] = 'PMA _ history ';
$ Cfg ['servers'] [$ I] ['designer _ coords '] = 'PMA _ designer_coords ';
$ Cfg ['servers'] [$ I] ['tracking'] = 'PMA _ tracking ';
$ Cfg ['servers'] [$ I] ['userconfig'] = 'PMA _ userconfig ';
$ Cfg ['servers'] [$ I] ['recent '] = 'PMA _ recent ';
$ Cfg ['servers'] [$ I] ['Table _ uiprefs '] = 'PMA _ table_uiprefs ';

/*
* End of servers configuration
*/

?>
Then add the following code after $ cfg ['Lang '] =:

$ Cfg ['servers'] [$ I] ['port'] = '000000'

Save and restart apache. Enter localhost/phpmyadmin in the address bar to directly access the phpmyadmin management interface.

This method is not safe and has not been verified. Anyone can go to phpmyadmin to manage the database. Return to the configuration file and find the following code:

The code is as follows: Copy code

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

If you change the config of the above code to cookie or http, the verification interface will appear (the verification interface for cookie and http is different on windows). I changed it to cookie, the image verification page is displayed.

2. This method also modifies the phpmyadmin configuration file, but the path is different. Find the config. default. Php file in phpmyadmin/libraries, which contains various server configuration parameters.

$ Cfg ['servers'] [$ I] ['port'] = '';

Find this line of code. In line 132, the port is configured. If the value is null, the default value is 3306. Change the value to 3307, save the code, and restart apache, you can also access phpmyadmin.

II. phpmyadmin configuration file details

Open phpmyadmin/libraries and find the config. default. Php file. The common parameter configuration is as follows:

The code is as follows: Copy code

$ Cfg ['pmaabsoluteuri '] = ''; // phpmyadmin access URL, which is the default value.
$ Cfg ['translationwarningthreshold '] = 80; // server port
$ Cfg ['servers'] [$ I] ['host'] = 'localhost'; // ip address of the mysql host. If mysql and phpmyadmin are on the same server, press the default localhost
$ Cfg ['servers'] [$ I] ['port'] = '000000'; // mysql port. The default value is 3307. Leave it blank.
$ Cfg ['servers'] [$ I] ['user'] = 'root'; // mysql username
$ Cfg ['servers'] [$ I] ['password'] = ''; // password
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'cooker'; // authentication method
/* You can configure the port, user name, and authentication method in config. inc. php with a high priority.
* $ Cfg ['servers'] [$ I] ['auth _ type'] = 'config'; this is in config. inc. php
* Configuration. If this value is not modified, you can still directly access phpmyadmin.
*/
$ Cfg ['defaultlang '] = 'zh'; // set the default language


The authentication method $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker'; has four values: cookie, http, HTTP, config

In config mode, you can directly access the phpmyadmin access url without entering the user name and password. It is insecure and is not recommended.

When this option is set to cookie, http, or HTTP, you need to verify the data username and password to log on to phpmyadmin. The details are as follows:

The PHP installation mode is Apache, and http and cookie can be used;

The PHP installation mode is CGI. You can use cookies.

In cookie mode, you can also set $ cfg ['blowfish _ secret'] = "; (phrase password). You have to decide why to set the password, or ignore it. (I have never tested it. This is from the instructions in this document. I don't think it's enough to ignore it)

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.