Updating Column Descriptions (Comments)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello all,

Looking for some help here.  BTW, to e-mail me directly, should you
prefer, take the *nomail*. out the reply address.

I uploaded data from another program ( GNU R-2.2.0 @ www.r-project.org )
into a MySQl (4.1.X ) database.  R generated the tables for me, naming
the columns, setting field types, and inserting the records.  This is
good, as it was about 100MB of data across 13 tables, each with between
50 and 200 fields in each table.

The original data file also has field descriptions, long comments
describing the contents of the column.  Unfortunately, R does not add
the appropriate MySQL column comments.  So, my question is, how can I
update these comments.

Right now, I have them in a format that would be easy to insert into a
MySQL table.  Each comment is a row of data.  The columns contain the
field names, which are the same as the field names in the MySQL database.

But, I cannot figure out how and where MySQL stores this metadata.  Is
there a table that I can update directly with these values?  Any help
would be appreciated.

This is on Linux, Ubuntu Breezy 5.10.


Re: Updating Column Descriptions (Comments)

Quoted text here. Click to load it

CREATE TABLE has a syntax for a table option COMMENT = 'string'.
ALTER TABLE can take the same option:

  ALTER TABLE myTable COMMENT = 'fee fie fo fum';

Likewise you can add comments to individual columns:

    myColumn INTEGER COMMENT 'bee bie baz';

(that syntax requires that you first list the column name, and then the
whole column definition, including repeating the column name.)

You can see the comments if you show the table:


Bill K.

Site Timeline