0
I have an encrypted field in the MYSQL database. I’m trying to update this way
UPDATE USUARIOS
SET SENHA = md5(1234)
WHERE ID = 216;
but give me this error message:
Error Code: 1406. Data Too long for column 'PASSWORD' at rom 1
0
I have an encrypted field in the MYSQL database. I’m trying to update this way
UPDATE USUARIOS
SET SENHA = md5(1234)
WHERE ID = 216;
but give me this error message:
Error Code: 1406. Data Too long for column 'PASSWORD' at rom 1
0
Without the table creation script there is no way to know how many characters the "password" column supports, but the error indicates that the value being assigned to the field has a larger number of characters than it accepts. Check how many characters your hash is generating and, if so, increase the number of characters in the field so that it can store the returned value.
I increased to varchar(100) and it changes, but at the time of I do the loguin, does not recognize
But what about the update? It worked and stopped giving the error that was asked?
Update worked, only the password was not changed to what I put
You can post a better example of this?
Then I have to see with the guy who has the source code, because I do not change it. I only make changes in the bank
I understand. If my answer helped you I am happy, and when I get the source about the other problem post it in a new question.
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
What is the USUARIOS table creation script?
– thxmxx
The number of characters returned by
md5()
must have exceeded the limit ofsenha
– rray
the password column is varchar(20)
– Leonardo Palmieri
Md5 does not generate a 32 chars hash ?
– Pedro Augusto
So it kind of encrypts, if it only has 20 spaces?
– Leonardo Palmieri
Hence "Too long data" error. Increase to 32 and test
– Pedro Augusto
Count how many characters there are in
$SENHA
https://ideone.com/7Xx0D1– user60252
I increased to varchar(100) and it changes, but at the time of I do the loguin, does not recognize
– Leonardo Palmieri
and how you’re doing the loguin?
...where senha= ????
– user60252
Make sure you’re comparing md5 to md5, not md5 password.
– Pedro Augusto
$password = MD5($_POST['password']);
– user60252
Then I have to see with the guy who has the source code, because I don’t change it.
– Leonardo Palmieri