Home > Web Front-end > HTML Tutorial > MySQL database connection failed? _html/css_WEB-ITnose

MySQL database connection failed? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:16
Original
1272 people have browsed it

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:xampphtdocsliuyanbanconfig.php on line 3
Database connection failed

My code:
header('Content-Type: text/html;charset=utf-8');
$conn=mysql_connect('localhost',' root','111111')or die("Database connection failed");
mysql_select_db("guestbook")or die("Data table connection failed");
?>


Reply to discussion (solution)

No port number required?
See what the people below say

No database specified
I don’t understand PHP

MySQL

My new blog http://www.xiaxiaoyuzone.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template