我是PHP新手。在执行我的应用程序时,我得到了以下错误:访问被拒绝用户'root'@ localhost mysql错误1045
在phpMyAdmin的代码是这样的
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
正如我已经收回了,我上面的代码更改为
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Pass123';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
现在我得到以下错误
访问被拒绝用户'root'@'localhost'(使用密码:YES)MySQL错误#:1045
请让我知道,出了什么错在这里。
你有没有确认是否1)你有正确的用户名/密码? 2)你的域名是否可以实际连接到mysql服务器(使用phpMyAdmin来验证) – JohnP 2011-04-05 04:43:33
你有没有做过一点搜索,请参阅http://stackoverflow.com/questions/2912761/beginner-mysql-error-access-denied http ://stackoverflow.com/questions/2540794/unable-to-access-mysql-from-myphpadmin-after-setting-root-password-in-easyphpwam http://stackoverflow.com/questions/3532868/mysql-error- 1045-access-denied – gideon 2011-04-05 04:45:07
分享一些代码....所以我们可以帮忙,似乎你没有通过正确的密码到函数mysql_connect – Necronet 2011-04-05 04:46:05