Originally Posted By: Shaba1
I need the same thing to a mysql database.


Please start your own thread.

The answer to your question is in the MySQL security FAQ which you can find at http://dev.mysql.com/doc/refman/5.0/en/faqs-security.html#qandaitem-26-9-4

Specifically the entry:
 Quote:
26.9.4: Does MySQL 5.0 have built-in authentication against LDAP directories?

No. Support for external authentication methods is on the MySQL roadmap as a “rolling feature”, which means that we plan to implement it in the future, but we have not yet determined when this will be done.


In other words, no, there is no simple way to integrate AD authentication.

If you only need lightweight security, you could get around the problem by implementing a simple password system. Either use the username as a seed to generate a pseudo-random password, or use something like the users SID as the password. This would allow you to automatically connect to the DB without making the user enter a password.

If you use the SID make sure that you reverse it, so that the most significant part is at the start!

The hash method is better, as it means users cannot easily guess the password of another user. It also measn that you can later change all the passwords by tweaking the password generation mechanism if it is discovered - either by changing the password generation script or perhaps by keeping a "salt" value on a read-only share.

In either case, you will need to ensure that the script is tokenised, otherwise your users will be able to read / copy the code and break in.