+ -
当前位置:首页 → 问答吧 → MySQL数据库连接失败?

MySQL数据库连接失败?

时间:2011-10-23

来源:互联网

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\liuyanban\config.php on line 3
数据库连接失败

我的代码 :
<?php
header('Content-Type:text/html;charset=utf-8');
$conn=mysql_connect('localhost','root','111111')or die("数据库连接失败");
mysql_select_db("guestbook")or die("数据表连接失败");
?>

作者: chentian114   发布时间: 2011-10-23

不需要端口号?
看楼下怎么说

作者: wby13579   发布时间: 2011-10-23

不指定数据库
PHP不懂

作者: wby13579   发布时间: 2011-10-23

MySQL

作者: chentian114   发布时间: 2011-10-23