MySQL修改root密码以及phpmyadmin提示1045错误的那些破事

2018-08-04 03:20:24
Reading:315

首先可通过如下语句清除root密码:
UPDATE `user` SET `plugin` = '', `authentication_string` = '' WHERE `user`.`Host` = 'localhost' AND `user`.`User` = 'root';

其次遭遇 phpmyadmin 提示:mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) 时,
可进行如下配置修改:

一是config.inc.php的

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

二是config.sample.inc.php的

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

反正看见password的地方都给我留意一下,修改为符合自己的需求就好。
修改保存后,要重启MySQL服务。

About

When I was young
I'd listen to the radio
Waiting for my favorite songs
When they played I'd sing along
It made me smile
Those were such happy times
And not so long ago
How I wondered where they'd gone
But they're back again
Just like a long lost friend
All the songs I loved so well