今天在練習mysql發現為什麼密碼欄位範例都會加密

而自已輸入的卻都沒加密、因此上網查了一下

結果發現、只要在設定密碼值的前面加上md5()就好了

例如:update user set password=md5('result') where username='result'

或者是:insert into user (`username`, `password`, `email`, `role`, `activated`, `banned`) values ('joe', md5('joe'), 'joe@email.com.tw', '1', '0', '0')

這樣問題就解決了

arrow
arrow
    全站熱搜

    result945 發表在 痞客邦 留言(0) 人氣()