初学PHP!请问

Jun 13, 2016 pm 01:42 PM
connect localhost mysql php quot

初学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 比较好……
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

How to fix mysql_native_password not loaded errors on MySQL 8.4

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

See all articles