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 ......