Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of phpmyadmin being unable to connect to the mysql server

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the solution that phpmyadmin can not connect to the mysql server. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The question leads to:

Error:

MySQL returns: document

Unable to connect: invalid setting.

PhpMyAdmin tried to connect to the MySQL server, but the server refused to connect. You should check the host, user name, and password in the configuration file and verify that this information is consistent with the information given by the MySQL server administrator.

The cause of the problem:

Found that the default mysql account of xampp is an empty password, although it is only a local debugging environment, it is still not very comfortable, so the password is changed and this error occurs when you visit phpmyadmin again.

This is because the default login method of phpmyadmin in xampp is to log in directly by recording the account password in the configuration file rather than through the login interface, but after changing the password, it does not match the account password in the configuration file, so there is an error.

Solution:

1. The "root" user in MySQL sets the password (for example, the native MySQL password is 123456). Please use the "mysqladmin" command in the console. For example:

D:\ xampp0\ mysql\ bin\ mysqladmin.exe-u root password 123456

In addition, if there is a previous password, the modify command is:

D:\ xampp0\ mysql\ bin\ mysqladmin.exe-u root-p password 123456

Enter after you are prompted to enter the password, enter the "old password" can be.

2. Find the configuration file information of config.inc.php under phpMyAdmin under xampp

Modify it to the following

/ * Authentication type and info * / $cfg ['Servers'] [$I] [' auth_type'] = 'config';$cfg [' Servers'] [$] ['host'] =' localhost';$cfg ['Servers'] [$I] [' connect_type'] = 'tcp';$cfg [' Servers'] [$I] ['compress'] = false;$cfg [' Servers'] [$I] ['user'] =' root';$cfg ['Servers'] [$I] [' password'] = '123456' $cfg ['Servers'] [$I] [' extension'] = 'mysql';$cfg [' Servers'] [$I] ['AllowNoPassword'] = true;$cfg [' Servers'] [$I] ['auth_type'] =' config'; where config is changed to $cfg ['Servers'] [$I] [' auth_type'] = 'cookie'

From now on, you need to enter the password of "root" correctly to start PHPMyAdmin.

Then click phpmyadmin and set the mysql password to 123456 in the graphical interface. Problem solved.

The new password takes effect after restarting the MySQL service!

This is the end of this article on "phpmyadmin can not connect to the mysql server". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report