如何让 phpMyAdmin 询问我的用户名和密码

ani*_*tha 7 mysql php password

我在 mysql 5 中使用了 rhel 5 和 php 5。我的服务器已经配置好并且所有应用程序都在顺利运行。我正在以 root 身份访问 mysql 并提供我的密码。但是,当我通过浏览器访问 phpmyadmin 时,它并没有要求我输入密码。有人请告诉我如何设置它以提示输入用户名和密码。由于我不熟悉 php 和 mysql,请告诉我如何以简单的方式进行操作。

tft*_*ftd 10

这很容易做到。
转到 /my/path/to/phpmyadmin/config.inc.php。用你最喜欢的编辑器打开它,然后:

// Uncomment this line if it's commented. 
// Then insert a random string in the quotes ('').
// Have in mind not to enter symbols as " or ' in the quotes.
// You could use something like this - dsd87892@829109skmclwopa&
// It doesn't matter what exactly you type as long as it's not ' and " :)
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

// Then find this and set it to cookie. ( I don't know what's the default. )
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
Run Code Online (Sandbox Code Playgroud)

现在一切正常,应该要求输入用户名和密码。
此外,您可以像@Cocowalla 所说的那样添加 HTTP 身份验证 - 以获得更高的安全性。

希望这可以帮助 :)


Coc*_*lla 1

您可以对 phpMyAdmin 使用 Apache HTTP 身份验证,也可以在 phpMyAdmin 安装目录的 config.inc.php 文件中指定用户名和密码。

更多信息请参见此处