我最近在我的系统中安装了phpmyadmin
。现在我丢失了用户名和密码。我尝试了以下登录方法。
在etc/phpmyadmin/config.inc.php
我激活了 AllowNoPassword
$ cfg ['Servers'] [$ i] ['AllowNoPassword'] = TRUE;
答案 0 :(得分:8)
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'] = '';
答案 1 :(得分:3)
尝试使用新值更改以下行
$cfg['Servers'][$i]['user'] = 'NEW_USERNAME';
$cfg['Servers'][$i]['password'] = 'NEW_PASSWORD';
由于配置文件中缺少上述行而更新
停止MySQL服务器
sudo service mysql stop
启动mysqld
sudo mysqld --skip-grant-tables &
以root身份登录MySQL
mysql -u root mysql
使用新的root密码更改MYSECRET
UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit;
杀死mysqld
sudo pkill mysqld
启动mysql
sudo service mysql start
使用新密码以root身份登录phpmyadmin
答案 2 :(得分:2)
尝试打开config-db.php,它位于/ etc / phpmyadmin中。 在我的情况下,用户是phpmyadmin,我的密码是正确的。 也许你的问题是你使用通常的“root”用户名,而你的密码可能是正确的。
答案 3 :(得分:1)
如果您忘记了密码,请在命令行管理程序中运行此命令:
mysqladmin.exe -u root密码NewPassword
其中'NewPassword'是您的新密码。
答案 4 :(得分:-1)
我遇到了这个问题。我甚至没有创建任何密码,所以我很困惑。我搜索了它,我发现我应该只将 root 写为用户名而不是单击GO。 我希望它有所帮助。