当前位置:Gxlcms > 数据库问题 > 如何修改Xampp中MySQL的root密码?

如何修改Xampp中MySQL的root密码?

时间:2021-07-01 10:21:17 帮助过:2人阅读

),请在控制台中使用“mysqladmin”命令。例如:

d:\PHP\xampp\mysql\bin\mysqladmin.exe  -u  root  password  123456

另外,如果是先前有秘密,则修改命令为:

d:\PHP\xampp\mysql\bin\mysqladmin.exe -u root -p password 123456

回车后提示你输入密码,输入“旧密码”即可。

请注意,更改 root 的密码之后,不要忘记更改 PHPMyAdmin 中的相关信息。在 ...xamppphpmyadmin 下搜索“config.inc.php”并编辑下面几行:

$cfg[‘Servers‘][$i][‘user‘] = ‘root‘; // MySQL SuperUser
$cfg[‘Servers‘][$i][‘auth_type‘] = ‘http‘; // HTTP MySQL authentification

从今往后,需要正确输入“root”的密码才能启动 PHPMyAdmin。

 

重启MySQL服务后新密码生效!

 

参考:

<?php

$cfg[‘blowfish_secret‘] = ‘a8b7_snsgou.com_c6d‘;

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg[‘Servers‘][$i][‘verbose‘] = ‘localhost‘;
$cfg[‘Servers‘][$i][‘host‘] = ‘localhost‘;
$cfg[‘Servers‘][$i][‘port‘] = ‘‘;
$cfg[‘Servers‘][$i][‘socket‘] = ‘‘;
$cfg[‘Servers‘][$i][‘connect_type‘] = ‘tcp‘;
$cfg[‘Servers‘][$i][‘extension‘] = ‘mysqli‘;
$cfg[‘Servers‘][$i][‘auth_type‘] = ‘cookie‘;
$cfg[‘Servers‘][$i][‘AllowNoPassword‘] = false;

 

如何修改Xampp中MySQL的root密码?

标签:

人气教程排行