phpmyadmin 密码设置

phpmyadmin 密码设置

我正在尝试为我的 phpmyadmin 设置密码。我的 config.ini 文件是

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 3.4.10.1 setup script
 * Date: Sun, 22 Jul 2012 11:33:17 +0000
 */

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'triple';


/* End of servers configuration */

$cfg['blowfish_secret'] = '500be38d07a469.36176220';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>

但问题是,它让我使用任何输入作为密码。比如(khfjsdhfj)。怎么了?我该如何设置它?仅供参考,以前我没有任何密码可以登录。

答案1

密码保存在数据库中。您可以使用如下查询在数据库中设置权限:

GRANT <permissions> ON <database>.<table> TO <user> IDENTIFIED BY PASSWORD '<password>';

您还可以尝试使用 PHPMyAdmin 设置权限和密码。查找数据库权限并在那里设置密码。

PHPMyAdmin 之所以能帮你登录,是因为你设置了

$cfg['Servers'][$i]['nopassword'] = true;   <-- If password fails try 
                                                username and empty Password
...
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'triple';

显然你的数据库没有密码

相关内容