简体   繁体   English

在Wamp中的PhpMyAdmin中为用户输入密码

[英]Putting a password to a user in PhpMyAdmin in Wamp

How do you change the password for the root user in phpMyAdmin on WAMP server? 如何在WAMP服务器上的phpMyAdmin中更改root用户的密码? because I'm locked out of phpMyAdmin, after changing the password incorrectly. 因为我错误地更改密码后,我被锁定在phpMyAdmin之外。

my config.inc.php file in the phpmyadmin folder. 我在phpmyadmin文件夹中的config.inc.php文件。 Change username and password to the one you have set for your database. 将用户名和密码更改为您为数据库设置的用户名和密码。

    <?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
 */

?>

There is a file called config.inc.php in the phpmyadmin folder. phpmyadmin文件夹中有一个名为config.inc.php的文件。

The file path is C:\\wamp\\apps\\phpmyadmin4.0.4 文件路径为C:\\ wamp \\ apps \\ phpmyadmin4.0.4

Edit The auth_type 'cookie' to 'config' or 'http' 将auth_type'cookie'编辑为'config'或'http'

$cfg['Servers'][$i]['auth_type'] = 'cookie'; $ cfg ['Servers'] [$ i] ['auth_type'] ='cookie';

$cfg['Servers'][$i]['auth_type'] = 'config';

or 要么

$cfg['Servers'][$i]['auth_type'] = 'http';

When you go to the phpmyadmin site then you will be asked for the username and password. 当你去phpmyadmin网站时,你会被要求输入用户名和密码。 This also secure external people from accessing your phpmyadmin application if you happen to have your web server exposed to outside connections. 如果您的Web服务器碰巧暴露在外部连接中,这也可以保护外部人员不会访问您的phpmyadmin应用程序。

Get back to the default setting by following this step: 按照以下步骤返回默认设置:

Instead of 代替

$cfg['Servers'][$i]['AllowNoPassword'] = false;

change it to: 将其更改为:

$cfg['Servers'][$i]['AllowNoPassword'] = true;

in your config.inc.php file. 在你的config.inc.php文件中。

Do not specify any password and put the user name as it was before, which means root . 不要指定任何密码并将用户名置于之前,这意味着root

Eg 例如

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

This worked for me after i had edited my config.inc.php file. 在我编辑了config.inc.php文件后,这对我config.inc.php

i have some problems with it, and fixed it my using another config variable 我有一些问题,并使用另一个配置变量修复它

$cfg['Servers'][$i]['AllowNoPassword'] = true;
instead
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;

may be it will helpfull ot someone 可能会对某人有所帮助

Looks like phpmyadmin's username and password are stored elsewhere ( probably in a custom-defined config file ) in WAMP or there is some additional hashing or ... involved in the process. 看起来phpmyadmin的用户名和密码存储在WAMP中的其他位置(可能位于自定义配置文件中),或者在此过程中涉及一些额外的散列或...。

So to change currently used default 'config'-file-based password you can browse " <host>/phpmyadmin/user_password.php " using your browser. 因此,要更改当前使用的默认“基于配置”文件的密码,您可以使用浏览器浏览“ <host>/phpmyadmin/user_password.php ”。 You'll be prompted to enter your mysql credentials and then you can use the displayed form to change the stored password for the user you logged into previously. 系统将提示您输入您的mysql凭据,然后您可以使用显示的表单更改您之前登录的用户的存储密码。

Search your installation of PhpMyAdmin for a file called Documentation.txt. 在PhpMyAdmin的安装中搜索名为Documentation.txt的文件。 This describes how to create a file called config.inc.php and how you can configure the username and password. 这描述了如何创建名为config.inc.php的文件以及如何配置用户名和密码。

if didn't find any password use on command line mysql -u root -p it will ask password it will be default password of you type at startup of installation. 如果在命令行mysql -u root -p上没有找到任何密码,它会询问密码,它将是你在安装启动时输入的默认密码。 It will be your password for log in of phpmyadmin 它将是您登录phpmyadmin的密码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM