MySQL Password Function - OLD_PASSWORD() and PASSWORD()

The PASSWORD() function in MySQL can be used to generate a hash value for encrypted passwords, similar to using md5() in PHP. It is generally not recommended to use this function in an application as it is not particularly secure - it is intended for internal use.

If however your application uses the MySQL PASSWORD() function, you need to be aware that prior to MySQL 4.1 the function returns a 16 byte hash and in MySQL 4.1 and later the hash is 41 bytes. This means that a change of hosting or database upgrade will most likely result in your application breaking.

Fortunately, the function OLD_PASSWORD() is available in MySQL 4.1 and later to replicate the original PASSWORD() function. If you need a temporary solution, use OLD_PASSWORD() but make sure you update your code to be more secure as soon as you can.

Are you a Developer, Designer or Copy Writer? Or Looking For One?

Click here to see 100s of jobs updated every day that you can complete to earn good money. Also find that programmer, designer or copy writer you have been looking for - advertise and get the best guy for your job - click here to find out more

Leave a Reply

Make $100,000/Month - Every Month!

It Works! We Make Our Customers Millionaires! Act now and get $600 bonus and a Free Money Making Website! - click to get started