Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL Password Problems

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I use MySQL 3.23.41 and phpMyAdmin 2.2.0.

I want to access my database called books from a PHP script. With phpMyAdmin I create a user called bookorama with the password set to bookorama. In the host field I type localhost. I give this user no global privileges. But I grant him select and insert on the whole database called books. Very strange that then the passoword of that user has been automatically changed to something like 6a27b1810cb043de. Why that? But I set it back to bookorama. Then in my PHP script I try to log on to the database using @ $db = mysql_connect("localhost", "bookorama", "bookorama"); But unfortunately $db returns a error, which means that the conncection was refused. Why? I have set up that user with the password!

Please help me on my question. I'm still a beginner.
 
When you submitted the password, the mysql engine encrypted it. So now, you have to pass in the encrypted version. There is a php function available to you but for the life of me, I cannot remember the name of it. Check out the php.net help pages. I hope this helps you out a bit. Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
 
The MySQL function is password() but you shouldn't need to use it. The passwords are stored in encrypted format for security, so that even a person with read access to the table can't obtain other users passwords. The login process however, should take whatever password you supply and manage the comparison with the encryption in mind. I would say get rid of the "@" (it suppresses error messages) before the connect, and check the mysql error string. There are other reasons for a connection to fail beside a bad password.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top