Answer the question
In order to leave comments, you need to log in
Why does it give an error: 1062, u"Duplicate entry 'pbkdf2:sha256:50000$' for key 'user_password'"?
Hello everyone
Code for adding a user:
# read the posted value
_name = request.form['inputName']
_email = request.form['inputEmail']
_password = request.form['inputPassword']
# validate values
if _name and _email and _password:
# let's go
conn = mysql.connect()
cursor = conn.cursor()
_hashed_password = generate_password_hash(_password)
cursor.callproc('sp_createUser', (_name, _email, _hashed_password))
data = cursor.fetchall()
if (len(data) is 0):
conn.commit()
return json.dumps({'message': 'User created successfully !'})
else:
return json.dumps({'error': str(data[0])})
mysql> SET @@global.sql_mode= '';
Answer the question
In order to leave comments, you need to log in
"Duplicate entry 'pbkdf2:sha256:50000$' for key 'user_password'")
The first app, and then according to the guide
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question