【发布时间】:2010-10-04 15:25:57
【问题描述】:
如何在 WAMP 服务器的 phpMyAdmin 中更改 root 用户的密码?因为我在更改密码错误后被锁定在 phpMyAdmin 之外。
【问题讨论】:
标签: phpmyadmin wampserver
如何在 WAMP 服务器的 phpMyAdmin 中更改 root 用户的密码?因为我在更改密码错误后被锁定在 phpMyAdmin 之外。
【问题讨论】:
标签: phpmyadmin wampserver
如果在命令行上没有找到任何密码使用 mysql -u root -p 它会询问密码,这将是您在安装启动时输入的默认密码。 这将是您登录 phpmyadmin 的密码
【讨论】:
在 phpmyadmin 文件夹中有一个名为 config.inc.php 的文件。
文件路径为C:\wamp\apps\phpmyadmin4.0.4
将 auth_type 'cookie' 编辑为 'config' 或 'http'
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
或
$cfg['Servers'][$i]['auth_type'] = 'http';
当您访问 phpmyadmin 站点时,系统会要求您输入用户名和密码。如果您的 Web 服务器碰巧暴露在外部连接中,这也可以防止外部人员访问您的 phpmyadmin 应用程序。
【讨论】:
看起来 phpmyadmin 的用户名和密码存储在 WAMP 中的其他位置(可能在自定义配置文件中),或者在此过程中涉及一些额外的哈希或...。
因此,要更改当前使用的默认“config”文件密码,您可以使用浏览器浏览“<host>/phpmyadmin/user_password.php”。系统将提示您输入 mysql 凭据,然后您可以使用显示的表单更改您之前登录的用户的存储密码。
【讨论】:
按照以下步骤返回默认设置:
代替
$cfg['Servers'][$i]['AllowNoPassword'] = false;
改成:
$cfg['Servers'][$i]['AllowNoPassword'] = true;
在您的 config.inc.php 文件中。
不要指定任何密码,输入之前的用户名,即root。
例如
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
在我编辑了 config.inc.php 文件后,这对我有用。
【讨论】:
我有一些问题,我使用另一个配置变量修复了它
$cfg['Servers'][$i]['AllowNoPassword'] = true;
instead
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
可能对某人有帮助
【讨论】:
我的 config.inc.php 文件在 phpmyadmin 文件夹中。 将用户名和密码更改为您为数据库设置的用户名和密码。
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'enter_username_here';
$cfg['Servers'][$i]['password'] = 'enter_password_here';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
/*
* End of servers configuration
*/
?>
【讨论】:
在您的 PhpMyAdmin 安装中搜索名为 Documentation.txt 的文件。这描述了如何创建一个名为 config.inc.php 的文件以及如何配置用户名和密码。
【讨论】: