OCTET_LENGTH( )

This MySQL function returns the number of bytes contained in the given string.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

OCTET_LENGTH(string)

Explanation

This function returns the number of bytes contained in the given string. It is not aware of multi-byte characters, so it assume there are eight bits to a byte and one byte to a character. An octet is synonymous with byte in most contexts nowadays, so this function is an alias of LENGTH( ). See the description of that function for examples of its use.