Home > Database > Mysql Tutorial > body text

How to Fix the \'Cannot Log In to the MySQL Server\' Error in phpMyAdmin?

DDD
Release: 2024-10-30 00:53:03
Original
959 people have browsed it

How to Fix the

phpMyAdmin Login Error: #2002 Cannot Log In to the MySQL Server

When trying to log in to phpMyAdmin, users may encounter the error message "#2002 cannot log in to the mysql server phpmyadmin," particularly during installation. This issue arises due to an incorrect host address configured in phpmyadmin/config.inc.php.

To resolve this error, edit the config.inc.php file and modify the following line:

$cfg['Servers'][$i]['host'] = 'localhost';
Copy after login

Replace "localhost" with the IP address of your MySQL server. For a local machine, this will typically be "127.0.0.1."

$cfg['Servers'][$i]['host'] = '127.0.0.1';
Copy after login

After making this change, restart your web server or reload your browser. This should allow you to log in to phpMyAdmin successfully.

If config.inc.php doesn't exist during a fresh install, create it by renaming (or copying) config.sample.inc.php and changing the host address accordingly.

The above is the detailed content of How to Fix the \'Cannot Log In to the MySQL Server\' Error in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!