Select rows from database by strlen
LENGTH("my_string")
Return the length of a string in bytes
SELECT * FROM table_name WHERE LENGTH(column_name) < 5
Keep in mind that characters can be made up of multiple bytes like those in UTF-8.
SELECT * FROM table_name WHERE CHAR_LENGTH(column_name) < 5