Home > Backend Development > PHP Tutorial > 初学PHP!请问

初学PHP!请问

WBOY
Release: 2016-06-13 10:10:30
Original
874 people have browsed it

初学PHP!请教!

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$con=mysql_connect("localhost","root","1234")or die("Á¬½Óʧ°Ü");
Copy after login


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in D:\www_local\bbs\conn.php on line 2
连接失败


只有这一句代码,就报这样的错误!!!
我用的是wamp5的集成开发包,在想是不是什么配置错了,但是修改了php.ini里面的相应配置,还是同样错误。。。。求大师指点下。。。

------解决方案--------------------
wampserver 自带的数据库改了密码,很麻烦的 config.inc.php 里要改,重启浏览器。
------解决方案--------------------
在mysql命令行登录下看看你的密码是否正确.
mysql -u root -p
------解决方案--------------------
如果通过命令行能进去,也就是密码什么的,是正确的,
再使用127.0.0.1连接,不要用localhost,万一没绑定localhost呢,呵呵
------解决方案--------------------
好像Wamp改了数据库的密码会很麻烦,所以还是用appserv 比较好……
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