Home  >  Article  >  Database  >  How to set login password for phpmyadmin

How to set login password for phpmyadmin

尚
Original
2019-12-09 15:27:584533browse

How to set login password for phpmyadmin

phpMyAdmin is directly connected to MYSQL, so security is very critical. Some friends do not set a login password for phpMyAdmin for convenience. This is very dangerous. If this address is If others know, your MYSQL will be finished.

So for the sake of security, we still have to set a password for phpMyAdmin. Under normal circumstances, this password is consistent with the MYSQL password. By default, phpMyAdmin does not enable the function of logging in and re-entering. We can Enable this function through the following code:

Open config.inc.php in the root directory of phpMyAdmin and modify it according to the following lines:

$cfgServers[$i]['auth_type']= 'cookie';

There are three parameters here, cookie is one of them One, the other two parameters are config and http,

config means: according to the password in the configuration file (that is, the standard method) This method has no authentication;

http : Use HTTP authentication;

cookie: Use COOKIE for login authentication. If you use IIS PHP, HTTP authentication is invalid. This function can only be used in the APACHE server environment. Under normal circumstances, the COOKIE method is used.

phpMyAdmin configuration file is in config.default.php under libraries. The main configuration is as follows:

Generally, if your mysql and phpmyadmin are placed on the same server, the host name is directly localhost

$cfg['Servers'][$i]['host'] = 'localhost';

Then you need to configure the user name and password of mysql:

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = *****';

Recommended related articles and tutorials: phpmyadmin tutorial

The above is the detailed content of How to set login password for phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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