Access denied for user 'root'@'localhost' (using password: YES)问题
刚开始学PHP,设置MySql的时候,编辑一个php文件为
<?php
$conn=mysql_connect("localhost","root","root");
if ($conn)
{
echo "链接数据库成功";
}
else
{
echo "链接数据库失败";
}
?>
打开浏览器设置后出现以下代码
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in D:\Apache Software Foundation\Apache2.2\htdocs\TEST_MySql.php on line 2
请哪位大神帮我解决以下,我是新手,最好能详细以下,谢谢大家。 MySql??PHP?
[解决办法]
虽然我不懂PHP,但是我觉得这里应该不是这样吧
$conn=mysql_connect("localhost","root","root");
我觉得应该是
$conn=mysql_connect("服务器名称或IP","登录账户","登录密码");
这样吧
[解决办法]
先试试你的root能不能连到mysql,如果不行,发去mysql或者php专区吧
[解决办法]
最主要的是这个提示
Access denied for user 'root'@'localhost' (using password: YES)
[解决办法]
CMD 里能进MYSQL吗?
[解决办法]