XAMPP: Access to phpMyAdmin Error resolution

Source: Internet
Author: User
Tags mysql host

Source: http://www.ido321.com/1246.html

XAMPP (Apache+mysql+php+perl) is a powerful building XAMPP software station integration package, lightweight, easy to use. It provides a powerful phpMyAdmin database management tool that enables users to use and manage databases with ease. For issues where phpMyAdmin cannot be opened locally, my solution is as follows:

MySQL has a default dedicated port: 3306, so if you have previously installed MySQL independently, then 3306 ports are already occupied. When installing XAMPP integrated MySQL, you must reset the independent port, otherwise you cannot access phpMyAdmin, I receive the error message shown in the figure:

Modification method is also very convenient, open XAMPP Control Panel, find the right side of the MySQL config, click, will appear My.ini selection, this is the MySQL configuration file,

Of course just modify the port, I still can not access. Also to modify the phpMyAdmin configuration file, there are two ways:

One, access to phpMyAdmin error solution

1, open the XAMPP directory (the default installation directory, if modified, please find the XAMPP installation directory), open phpMyAdmin directory, in this directory found config.inc.php, my default configuration:

<?php/** This are needed for cookies based authentication to encrypt password in* Cookies */$cfg [' Blowfish_secret '] =' Xampp ';/* You should the 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 User name $cfg[' Servers '[$i] [' Password '] =' Password '; MySQL Password $cfg[' Servers '[$i] [' extension '] =' mysqli '; Extended configuration, if access is not configured mysqli such as error, plus this. Default is some $cfg[' Servers '[$i] [' Allownopassword '] =true; $cfg [' Lang '] ="';/ * Bind to the localhost IPv4 address and TCP * /$cfg [' Servers '[$i] [' Host '] =' 127.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_pages '] =' 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 '3307 '

Save, restart Apache, enter localhost/phpmyadmin in the Address bar, you can go directly to the phpMyAdmin management interface.


This approach is less secure, no validation, and anyone can access the phpMyAdmin management database. Back to the configuration file, find the following code:

$cfg [' Servers '] [$i] [' auth_type 'config '

Change the above code to a cookie, or HTTP, there will be a verification interface (the cookie and HTTP corresponding authentication interface is not the same on Windows), I changed it to a cookie, the authentication interface

2, this way is also modified phpMyAdmin configuration file, but the path is not the same, found in the Phpmyadmin/libraries config.default.php file, which contains the various configuration parameters of the server

$cfg [' Servers '] [$i] [' Port ';

Find this line of code, my line in 132, this is the configuration of the port, the value is null is the default of 3306, the value is changed to 3307, save, restart Apache, can also access phpMyAdmin

Second, phpmyadmin configuration file detailed

Open the config.default.php file found in phpmyadmin/libraries, common parameters are configured as follows

$cfg [' Pmaabsoluteuri '] ="';//phpmyadmin access URL, the default is the line$cfg [' Translationwarningthreshold '] = 80;//Server Port$cfg [' Servers '[$i] [' Host '] =' localhost ';//mysql Host IP, if MySQL and the phpMyAdmin are on the same server, press the default localhost$cfg [' Servers '[$i] [' Port '] =' 3307 ';//mysql Port, default 3306, left blank$cfg [' Servers '[$i] [' user '] =' Root ';//mysql User Name$cfg [' Servers '[$i] [' Password '] ="';//Password$cfg [' Servers '[$i] [' Auth_type '] =' Cookie ';//authentication method/ * port, user name, authentication mode, etc. can also be configured in config.inc.php, and high priority* $cfg [' Servers '] [$i] [' auth_type '] = ' config '; This one's in config.inc.php.* Configuration, if you do not modify this value, you can still directly access the phpMyAdmin*/$cfg [' Defaultlang ']=' en ';//Set default language

For the authentication method $cfg[' Servers ' [$i] [' auth_type '] = ' cookie '; Has a value of four: Cookie,http,http,config

The Config method is to enter the phpMyAdmin access URL directly, no need to enter the user name and password, is not safe, is not recommended to use.

When the entry is set to Cookie,http or HTTP, the login phpMyAdmin requires a data user name and password for authentication, as follows:

PHP installation mode is Apache, you can use HTTP and cookies;

PHP installation mode is CGI, you can use cookies.

In addition, in the cookie mode, you can also set $cfg[' blowfish_secret ' = "; (phrase password), as to why the password is set, it is up to you to decide, you can ignore it. (not tested, this comes from the documentation, I think it's okay to ignore it.)

Next article: How to generate PDF files in HTML using PHP

XAMPP: Access to phpMyAdmin Error resolution

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.