PHP beginners! Excuse me

Source: Internet
Author: User
PHP beginners! Ask! PHPcode $ con = mysql_connect (& quot; localhost & quot;, & quot; root & quot;, & quot; 1234 & quot;) ordie (& quot; & #193; & #172; & #189; & #211; & #202; & #167; & beginner PHP! Ask!
PHP code
  $con=mysql_connect("localhost","root","1234")or die("Á¬½Óʧ°Ü");


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
Connection failed


This error is reported only when this code is used !!!
I am using the wamp5 Integrated Development Kit. I was wondering if the configuration was wrong, but I modified the corresponding configuration in php. ini, which is still the same .... Ask the master for advice...

------ Solution --------------------
The password has been changed for the database that comes with wampserver. it is very troublesome to change in config. inc. php and restart the browser.
------ Solution --------------------
Log on to the mysql command line to check whether your password is correct.
Mysql-u root-p
------ Solution --------------------
If you can use the command line, that is, the password or something, it is correct,
Use 127.0.0.1 to connect again. do not use localhost. what if it is not bound to localhost?
------ Solution --------------------
It seems that it will be very troublesome to change the password of the database with Wamp, so it is better to use appserv ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.