집 >
백엔드 개발 >
PHP 튜토리얼 >
数据库访问异常Access denied for user ''@'localhost' to database 'xinjisudi'
数据库访问异常Access denied for user ''@'localhost' to database 'xinjisudi'
WBOY
풀어 주다: 2016-06-13 12:56:23
원래의
982명이 탐색했습니다.
数据库访问错误Access denied for user ''@'localhost' to database 'xinjisudi' 连接数据库报错 数据库访问错误Access denied for user ''@'localhost' to database 'xinjisudi'
连接数据库代码
$conn=mysql_connect("localhost","","") or die("数据库服务器连接错误".mysql_error());//创建数据库连接
mysql_select_db("xinjisudi",$conn) or die("数据库访问错误".mysql_error());//打开数据库
mysql_query("set names utf8");//解决乱码
?>
啥问题 希望各位帮忙