Recently looking at a big God's PHP background introduction.
According to his introduction of the xampp-apache+php development environment ~
Also step by step from the process-oriented → object-oriented PHP login verification function ~ See the following portal for details
Then in doing php+mysql, through the database query authentication user information came to a problem ~ always prompt Me
mysqli::mysqli (): (hy000/1045): Access denied for user ' root ' @ ' localhost '
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/4D/wKioL1V49wHhZPu0AADNJ8CzPL0685.jpg "title=" 1.PNG " alt= "Wkiol1v49whhzpu0aadnj8czpl0685.jpg"/> Online search for a bit of this problem is quite a lot of ~
The first is to make sure that PHP opens the MySQL extension and removes the comments from the MySQL statement in the php.ini file.
After the test did not improve, and continue to find
such as Baidu's http://jingyan.baidu.com/article/fedf07377da53e35ad897768.html
Use Phpadmin to do, I follow this also set a bit phpadmin also step by Step configuration config file, the result is still not.
Read a few More Posts http://bbs.csdn.net/topics/70023712
Http://blog.sina.com.cn/s/blog_759a5a7c01017dj0.html
Sina here said in the local cmd input mysql-u root-p, I follow the local input user name and password, unexpectedly also error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (usin G Password:yes)
Collapse! How do I create a table that I normally create?!
Look at my MySQL bar, is the download of MySQL, and no use XAMPP to bring the MySQL (there has not been tuned, and so the tune up to share ~)
Is it. I usually use MySQL Server instead of MySQL. So I can't wait for MySQL server's account to be local MySQL?
So in my Mysql.user table to modify the root password in localhost, try ~
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/51/wKiom1V4-pWTJQ9pAAKi3oli77U316.jpg "title=" 2.PNG " alt= "Wkiom1v4-pwtjq9paaki3oli77u316.jpg"/>
Now the CMD can be successfully certified.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/51/wKiom1V4-xLi5oRIAAFV7gXuuvg652.jpg "title=" 1.PNG " alt= "Wkiom1v4-xli5oriaafv7gxuuvg652.jpg"/>
Then ~ ~
Back to Apache, this time the PHP code can also be run successfully, you can read the information I created in the database of the table is the ~
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/51/wKiom1V4-3vxiYBFAABlJy7vEJI241.jpg "title=" 1.PNG " alt= "Wkiom1v4-3vxiybfaabljy7veji241.jpg"/>
So ~ If you have encountered a similar 1045 authentication error,
After checking your PHP and MySQL configuration if not yet ~ Try your local MySQL will be successful landing, do not like me to take a wrong account password has been trying ~
About php+mysql1045 Access denied for user error resolution-you might not expect it.