• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Problem in SQL (MySQL) select password column  RSS feed

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a password column using
Insert into table (password) values (PASSWORD(abc))
and ok,
but I can't select it back using
Select * from table where password="PASSWORD(abc)"
Or Select * from table where password=(Select PASSWORD(abc));
Empty set returned,why?
**I can only do it this way
1) Select PASSWORD(abc); get the encoded password
2) then Select * from table where password="Encoded String";
but I don't want to do in this indirect way
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had the same problem. Can I guess that you're not running *nux and are in Windows instead?
If you search the MySQL docs, the password function is supported by the crypt() system call. This doesn't exist in Windows. I had a search and I think there are implementations you can plug in, but I never bothered...
Is this the problem you are having?
Dave.
 
Ken Shamrock
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply. Yes I m using WinXP.
I've figured out the reason why now. The password column should be exceeds 16 char, otherwise its not enough to stored the encoded string. Now it's ok
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!