Skip to main content
September 17, 2024
Question

Character limit

  • September 17, 2024
  • 9 replies
  • 0 views

Hi Guys,

I have a requirement where the user has to fill in around 5000 characters in a paragraph field, is it possible to store 5000 characters to the database ? 

    9 replies

    September 17, 2024

    Hi [mention:b175a06358c24958b7f81793c6779902:e9ed411860ed4f2ba0265705b8793d05] 

    In Database VARCHAR columns can store up to 8000 characters

    September 17, 2024

    Yes but when i try to change the varchar length, i am getting the below error.

    Query error:
    #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

    stefanhelzle0001
    September 17, 2024

    The error message says: "You have to change some columns to TEXT or BLOBs". The field type TEXT is a good start.

    somasundaram.d
    September 17, 2024

    What is your current table structure? Are you trying to add a new column or update the existing one?

    September 17, 2024

    This is my table structure, and i am trying to update an existing field from varchar(2000) to varchar(5000). Also tried using text field for this requirement, but my process is failing once the user enters more than 4000 characters.

    somasundaram.d
    September 17, 2024

    There could be a possibility that total size of all fields in the table is more than the limit, 65535. Try changing all the varchar to text types. 

    Please refer this thread for more informations

    stackoverflow.com/.../row-size-too-large-error-in-mysql-create-table-query

    September 17, 2024

    Hi [mention:b175a06358c24958b7f81793c6779902:e9ed411860ed4f2ba0265705b8793d05] 

    The total size of all fields in the table is more than the limit, 65535, that's why you are getting this error.
    they are two options:
    1.You should use text type instead of varchar for long strings.
    2.Or else you should decrease the limit of existing varchar fields and increase the field limit which ever you want.

    September 17, 2024

    Thanks [mention:72ffa644327e4fa197837686e1eca5d8:e9ed411860ed4f2ba0265705b8793d05]