Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

could mysql table cell hold unlimited string?

could mysql table cell hold unlimited string?

I was wondering if a mysql table cell could hold an unlimited length string?  I can't seem to make it hold more than 255 charecters long.  Thanks in advance for any help or suggestions.

  data varchar(255) default NULL

RE: could mysql table cell hold unlimited string?

You should use another field type, for example TEXT which can hold as much as you've got free space on your HD. The TEXT field type is also called MEMO (for example in Ms Access).


RE: could mysql table cell hold unlimited string?

or LONGTEXT which is even bigger ;0)

Party on, dudes!

RE: could mysql table cell hold unlimited string?

"for example TEXT which can hold as much as you've got free space on your HD."

Well, not exactly. It depends on what bit your Operating System/processor is at. For example, a 64bit processor can hold a field that is 2 terabytes in size, where as with 32 bit, its more like 2 gigabits.


vic cherubini

RE: could mysql table cell hold unlimited string?

It might be worth seeing this from the MySQL manual for types TEXT and BLOB:

If you want to use GROUP BY or ORDER BY on a BLOB or TEXT column, you must convert the column value into a fixed-length object. The standard way to do this is with the SUBSTRING function. For example:
mysql> select comment from tbl_name,substring(comment,20) as substr
       ORDER BY substr;

If you don't do this, only the first max_sort_length bytes of the column are used when sorting. The default value of max_sort_length is 1024; this value can be changed using the -O option when starting the mysqld server. You can group on an expression involving BLOB or TEXT values by specifying the column position or by using an alias:
mysql> select id,substring(blob_col,1,100) from tbl_name
           GROUP BY 2;
mysql> select id,substring(blob_col,1,100) as b from tbl_name
           GROUP BY b;

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close