MySQL 如何获取phpmyadmin用户名和密码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26354704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:07:23  来源:igfitidea点击:

How to get phpmyadmin username and password

mysqlphpmyadmin

提问by John Mathew

I have intalled phpmyadminrecently in my system. Now I lost its username and password. I tried the below methods for login.

phpmyadmin最近在我的系统中安装了。现在我丢失了它的用户名和密码。我尝试了以下登录方法。

in etc/phpmyadmin/config.inc.phpI activated the AllowNoPassword

etc/phpmyadmin/config.inc.php我激活了AllowNoPassword

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

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

回答by Hara Prasad

 Step 1:

    Locate phpMyAdmin installation path.

    Step 2:

    Open phpMyAdmin>config.inc.php in your favourite text editor.

    Step 3:

    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Lang'] = '';

回答by geoandri

Try changing the following lines with new values

尝试使用新值更改以下行

$cfg['Servers'][$i]['user'] = 'NEW_USERNAME';
$cfg['Servers'][$i]['password'] = 'NEW_PASSWORD';

Updated due to the absence of the above lines in the config file

由于配置文件中缺少上述行而更新

Stop the MySQL server

停止 MySQL 服务器

sudo service mysql stop

Start mysqld

启动mysqld

sudo mysqld --skip-grant-tables &

Login to MySQL as root

以 root 身份登录 MySQL

mysql -u root mysql

Change MYSECRET with your new root password

使用新的 root 密码更改 MYSECRET

UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit;

Kill mysqld

杀死mysqld

sudo pkill mysqld

Start mysql

启动mysql

sudo service mysql start

Login to phpmyadmin as root with your new password

使用您的新密码以 root 身份登录 phpmyadmin

回答by Hanz Marín

Try opening config-db.php, it's inside /etc/phpmyadmin. In my case, the user was phpmyadmin, and my password was correct. Maybe your problem is that you're using the usual 'root' username, and your password could be correct.

尝试打开 config-db.php,它在 /etc/phpmyadmin 里面。在我的例子中,用户是 phpmyadmin,我的密码是正确的。也许您的问题是您使用的是通常的“root”用户名,而您的密码可能是正确的。

回答by Vidhyut Pandya

If you don't remember your password, then run this command in the Shell:

如果您不记得密码,请在 Shell 中运行以下命令:

mysqladmin.exe -u root password NewPassword

mysqladmin.exe -u root 密码 NewPassword

where 'NewPassword' is your new password.

其中“NewPassword”是您的新密码。

回答by Ana-Marija

I had a problem with this. I didn't even create any passwords so I was confused. I googled it and I found out that I should just write rootas username and than click GO. I hope it helps.

我遇到了这个问题。我什至没有创建任何密码,所以我很困惑。我用谷歌搜索,我发现我应该只写root作为用户名,然后点击 GO。我希望它有帮助。