【问题标题】:Change MySQL Root Password in XAMPP在 XAMPP 中更改 MySQL 根密码
【发布时间】:2021-05-04 14:24:30
【问题描述】:

我在我的 Windows 10 机器上安装了 XAMPP。似乎 PHPMyADmin 仅在数据库没有密码时才有效。我真的更喜欢为 root 数据库帐户设置密码。

我进入 XAMPP 控制面板 -> 用户帐户 -> 编辑 root 帐户的权限。

当我输入新密码并点击“开始”时,我刷新页面并显示无法连接。有没有什么方法可以设置 XAMPP 的 root 数据库密码,不会破坏 PHPMyAdmin?

【问题讨论】:

    标签: php phpmyadmin xampp


    【解决方案1】:

    打开C:\xampp\phpMyAdmin文件夹,然后打开config.inc.php:

    然后,像这样更改行:

    $cfg['Servers'][$i]['auth_type'] = 'config'; //change this to cookie from config
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    

    收件人:

    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    

    然后使用空白密码登录,然后转到 SQL 选项卡,然后运行:

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-15
      • 2014-08-25
      • 2017-05-01
      • 2012-03-31
      • 2014-07-17
      • 2013-10-31
      • 2013-01-24
      相关资源
      最近更新 更多