Using ”text” datatype for storing password hash in MySQL?Which MySQL data type to use for storing boolean valuesSecure hash and salt for PHP passwordsShould I use the datetime or timestamp data type in MySQL?Best way to store password in databasepassword salt datatypeHow do you use bcrypt for hashing passwords in PHP?Why is char[] preferred over String for passwords?How to hash long passwords (>72 characters) with blowfishHow to import an SQL file using the command line in MySQL?MySQL Row to store encrypted passwords
Complex numbers z=-3-4i polar form
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
Help with my training data
How to not starve gigantic beasts
A Paper Record is What I Hamper
All ASCII characters with a given bit count
NPN: Not fully sinking to GND
Multiple fireplaces in an apartment building?
Will I lose my paid in full property
Is it acceptable to use working hours to read general interest books?
A strange hotel
Drawing a german abacus as in the books of Adam Ries
Why do games have consumables?
A faster way to compute the largest prime factor
Restricting the options of a lookup field, based on the value of another lookup field?
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
Nails holding drywall
Is Electric Central Heating worth it if using Solar Panels?
Can a stored procedure reference the database in which it is stored?
What makes accurate emulation of old systems a difficult task?
"The cow" OR "a cow" OR "cows" in this context
Does the damage from the Absorb Elements spell apply to your next attack, or to your first attack on your next turn?
Does a large simulator bay have standard public address announcements?
How to keep bees out of canned beverages?
Using ”text” datatype for storing password hash in MySQL?
Which MySQL data type to use for storing boolean valuesSecure hash and salt for PHP passwordsShould I use the datetime or timestamp data type in MySQL?Best way to store password in databasepassword salt datatypeHow do you use bcrypt for hashing passwords in PHP?Why is char[] preferred over String for passwords?How to hash long passwords (>72 characters) with blowfishHow to import an SQL file using the command line in MySQL?MySQL Row to store encrypted passwords
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
No, this question is not a duplicate of the numerous ”What's the best MySQL datatype for storing passwords”.
My password hashes are currently made using pbkdfSync on node.js, and I have the output set to 128(Whatever bytes bits it is), and it's pushing out a 256 char hash.
You might ask what's the problem? Well, that's what I thought. before I got hit with this: ”Value too long for column password” when using VARCHAR.
Numerous google searches are saying that the varchar character limit is 65,535 characters, but for some reason for me it is only 255 and the hash is one char bigger than that.
So the question here is:
Should I change my hash output size, so I can use the CHAR datatype, or should I just keep using the TEXT datatype? Or is there a way to get the 65,535 characters limit for char and varchar?
I'm on the latest MySQL version.
Edit: There's more to this, I am encrypting the hashes and salts and the encrypted output is 512 chars for the hash and 344 for the salt!
mysql node.js database server passwords
add a comment |
No, this question is not a duplicate of the numerous ”What's the best MySQL datatype for storing passwords”.
My password hashes are currently made using pbkdfSync on node.js, and I have the output set to 128(Whatever bytes bits it is), and it's pushing out a 256 char hash.
You might ask what's the problem? Well, that's what I thought. before I got hit with this: ”Value too long for column password” when using VARCHAR.
Numerous google searches are saying that the varchar character limit is 65,535 characters, but for some reason for me it is only 255 and the hash is one char bigger than that.
So the question here is:
Should I change my hash output size, so I can use the CHAR datatype, or should I just keep using the TEXT datatype? Or is there a way to get the 65,535 characters limit for char and varchar?
I'm on the latest MySQL version.
Edit: There's more to this, I am encrypting the hashes and salts and the encrypted output is 512 chars for the hash and 344 for the salt!
mysql node.js database server passwords
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32
add a comment |
No, this question is not a duplicate of the numerous ”What's the best MySQL datatype for storing passwords”.
My password hashes are currently made using pbkdfSync on node.js, and I have the output set to 128(Whatever bytes bits it is), and it's pushing out a 256 char hash.
You might ask what's the problem? Well, that's what I thought. before I got hit with this: ”Value too long for column password” when using VARCHAR.
Numerous google searches are saying that the varchar character limit is 65,535 characters, but for some reason for me it is only 255 and the hash is one char bigger than that.
So the question here is:
Should I change my hash output size, so I can use the CHAR datatype, or should I just keep using the TEXT datatype? Or is there a way to get the 65,535 characters limit for char and varchar?
I'm on the latest MySQL version.
Edit: There's more to this, I am encrypting the hashes and salts and the encrypted output is 512 chars for the hash and 344 for the salt!
mysql node.js database server passwords
No, this question is not a duplicate of the numerous ”What's the best MySQL datatype for storing passwords”.
My password hashes are currently made using pbkdfSync on node.js, and I have the output set to 128(Whatever bytes bits it is), and it's pushing out a 256 char hash.
You might ask what's the problem? Well, that's what I thought. before I got hit with this: ”Value too long for column password” when using VARCHAR.
Numerous google searches are saying that the varchar character limit is 65,535 characters, but for some reason for me it is only 255 and the hash is one char bigger than that.
So the question here is:
Should I change my hash output size, so I can use the CHAR datatype, or should I just keep using the TEXT datatype? Or is there a way to get the 65,535 characters limit for char and varchar?
I'm on the latest MySQL version.
Edit: There's more to this, I am encrypting the hashes and salts and the encrypted output is 512 chars for the hash and 344 for the salt!
mysql node.js database server passwords
mysql node.js database server passwords
edited Mar 9 at 8:04
Hashmat
1114
1114
asked Mar 9 at 7:32
user109321948492842303user109321948492842303
13
13
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32
add a comment |
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:
ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:
ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32
add a comment |
1 Answer
1
active
oldest
votes
You can change the type of you column to VARCHAR(512) which will allow you to store more than 255 chars in your column (actually 512). It is possible to use value from 1 to 8000 there or VARCHAR(MAX) for biggest one (in situations when data entries length vary a lot).
In you case, try something like this:
`ALTER TABLE name_of_your_table
CHANGE COLUMN password password VARCHAR(512) NOT NULL DEFAULT '';`
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075073%2fusing-text-datatype-for-storing-password-hash-in-mysql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can change the type of you column to VARCHAR(512) which will allow you to store more than 255 chars in your column (actually 512). It is possible to use value from 1 to 8000 there or VARCHAR(MAX) for biggest one (in situations when data entries length vary a lot).
In you case, try something like this:
`ALTER TABLE name_of_your_table
CHANGE COLUMN password password VARCHAR(512) NOT NULL DEFAULT '';`
add a comment |
You can change the type of you column to VARCHAR(512) which will allow you to store more than 255 chars in your column (actually 512). It is possible to use value from 1 to 8000 there or VARCHAR(MAX) for biggest one (in situations when data entries length vary a lot).
In you case, try something like this:
`ALTER TABLE name_of_your_table
CHANGE COLUMN password password VARCHAR(512) NOT NULL DEFAULT '';`
add a comment |
You can change the type of you column to VARCHAR(512) which will allow you to store more than 255 chars in your column (actually 512). It is possible to use value from 1 to 8000 there or VARCHAR(MAX) for biggest one (in situations when data entries length vary a lot).
In you case, try something like this:
`ALTER TABLE name_of_your_table
CHANGE COLUMN password password VARCHAR(512) NOT NULL DEFAULT '';`
You can change the type of you column to VARCHAR(512) which will allow you to store more than 255 chars in your column (actually 512). It is possible to use value from 1 to 8000 there or VARCHAR(MAX) for biggest one (in situations when data entries length vary a lot).
In you case, try something like this:
`ALTER TABLE name_of_your_table
CHANGE COLUMN password password VARCHAR(512) NOT NULL DEFAULT '';`
edited Mar 11 at 7:15
answered Mar 11 at 7:04
PashaPasha
199115
199115
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075073%2fusing-text-datatype-for-storing-password-hash-in-mysql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
So you want a password column with datatype VARCHAR(856) ?
– TGrif
Mar 9 at 17:40
@TGrif No, im using a separate column/entry for the hash. Is there a way to use varchar for more than 255 chars? Should i down my hashing function, or keep using text data type?
– user109321948492842303
Mar 9 at 17:46
I guess @TGrif meant that you can change the type of you column to VARCHAR(856) which will allow you to store more than 255 chars (actually 856) in your column. Try something like this:
ALTER TABLE name_of_your_table CHANGE COLUMN password password VARCHAR(856) NOT NULL DEFAULT '';
– Pasha
Mar 10 at 19:31
@Pasha wow I umm this is awkward and weird.. didnt know that worked? Problem is now solved. Thanks I guess. Cant upvote you thought.
– user109321948492842303
Mar 10 at 19:32