一步解决#1045 - Access denied for user 'root'@'localhost' (using password: NO) 的问题

解决办法是:

在phpMyAdmin中libraries目录下找到config.default.php文件

$cfg['Servers'][$i][ 'host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
 //找到下面这行,如果你的mysql数据库设置了登陆密码,则在此处添加你的登陆密码,
//如我的mysql密码为root则改成 $cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['only_db'] = '';

转载于:https://www.cnblogs.com/yannime/p/5814057.html

你可能感兴趣的:(数据库,php)