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;








0















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!










share|improve this question
























  • 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

















0















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!










share|improve this question
























  • 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













0












0








0








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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0














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 '';`





share|improve this answer

























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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 '';`





    share|improve this answer





























      0














      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 '';`





      share|improve this answer



























        0












        0








        0







        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 '';`





        share|improve this answer















        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 '';`






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 11 at 7:15

























        answered Mar 11 at 7:04









        PashaPasha

        199115




        199115





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved