Home  >  Q&A  >  body text

Database - Is there a function in mysql to check the data size??

What is the length() function in mysql? Isn’t it checking the number of characters:
length('Hello') //Return 7

Is there any other function that returns the number of bytes? Please help!

怪我咯怪我咯2691 days ago670

reply all(1)I'll reply

  • 为情所困

    为情所困2017-06-06 09:53:55

    length() returns the number of bytes occupied by storage, char_length() returns the number of characters.
    For example, length('Hello') should return 6 under the utf8 character set, char_length('Hello') should return 2.

    reply
    0
  • Cancelreply