目前我的数据库存储的“密码”文本,但这说,如下图所示(该密码也被转换成MD5哈希值),这是行不通的:商店MD5散列SQLITE3数据库蟒蛇
密码“功能“:
user_in = input("Please enter a password next to this text: \n")
Password = hashlib.md5()
Password.update(user_in.encode("utf-8"))
错误消息:
sqlite3.InterfaceError: Error binding parameter 1 - probably unsupported type.
我想知道的是我怎么哈希存储在数据库中SQLITE3
编辑:
cursor=db.cursor()
sql="insert into Accounts (Username, Password) values(?,?)"
cursor.execute(sql, (Username, Password))
db.commit()
编辑2:
user_in = input("Please enter a password next to this text: \n")
Password = hashlib.md5()
Password.update(user_in.encode("utf-8"))
Password.hexdigest()
你运行Python函数时收到错误,或者实际上它提交到SQLServer的呢? – Polymer
@Polymer再次嗨。我在输入用户名和密码后收到错误,所以当它提交给SQL服务器时 – Josh
您可以添加您用来提交给服务器的代码吗?在你的服务器上,你的密码是什么类型? – Polymer