Reputation: 752
At the moment I have a database field which stores passwords like this:
TeacherPassword
j.lu01
pesci02
cricket01
But I want to change the password field so that each row contains hashes for each password. But how can this be done because I tried an update like below but it did not work:
UPDATE Teacher
SET SHA2 TeacherPassword
I am using sql in phpmyadmin
Upvotes: 0
Views: 302
Reputation: 247810
MySQL has a SHA1()
function
UPDATE Teacher
SET SHA1(TeacherPassword)
Or even Password()
UPDATE Teacher
SET Password(TeacherPassword)
Encryption functions in MySQL
Upvotes: 1