View Full Version : make login case-sensitive with MySQL database

08-18-2006, 01:49 PM
I have a MySQL database. A user logs in to my site using a form. (at www.crmpicco.co.uk)


How can i make the login case sensitive?

My script is ASP with JavaScript.



08-18-2006, 02:29 PM
This very much depends on implementation. I would have thought unless you were upper / lower-casing usernames and passwords, by default it would be case sensitive?

08-18-2006, 03:24 PM
when i login with maplank as the username it doesnt differentiate between maplank and MaPlank (what is in the DB)

08-18-2006, 03:27 PM
[Edited because I was talking complete rubbish... just goes to show: do *NOT* assume all DBMS's are equal!]

08-18-2006, 04:11 PM
See the manual, you can force a case sensitive search quite easily performing a case sensitive search (http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html).

The problem of course is that you can't store unique names in such a field. that is because Dave and dave would both be seen as equivalent as far as non-unique names. but if you don't set the field as unique and do search as the above link suggests then you are all set.

By default I'm not sure if that is true of only windows or not but know that the two would be unique under linux/unix.

The link above though also has a link to making the column case sensitive then I guess you could have those two users be recognized as unique.