Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4533348
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:08:41+00:00 2026-05-21T14:08:41+00:00

I have a MySQL database that, I would like to annotate by adding comments

  • 0

I have a MySQL database that, I would like to annotate by adding comments to all of the columns,

From what I read on the MySQL documentation, it is necessary to include the data type and all attributes when changing any single one of these.

For example, I must type

ALTER TABLE `dbname`.`tablename` 
  CHANGE COLUMN `columnname` `columnname` 
  INT(11) NULL DEFAULT NULL COMMENT 'this is my comment`; 

It would be much faster for me to avoid having to restate the column info for each change, for example, by only having to submit a command such as:

ALTER TABLE `dbname`.`tablename` 
 CHANGE COLUMN `columnname` 
 COMMENT 'this is my comment`; 

Are there any options for adding comments that do not require me to restate the table structure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:08:41+00:00Added an answer on May 21, 2026 at 2:08 pm

    The documentation is pretty clear that CHANGE COLUMN requires the full column definition:

    CHANGE [COLUMN] old_col_name new_col_name column_definition

    Anything optional would be in brackets.

    Your best bet is probably to write a little one-off script to produce your ALTER TABLE commands based on the table’s current schema. You should be able to extract the column definitions from whatever data access layer you’re using.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several columns in a MySQL database that I would like to add
I have a MySQL user added to a database that I would like to
I have a MySQL database (currently using phpmyadmin to manage) that I would like
I am returning results from a MySql database in PHP that I would like
I have a MySQL database that is exhibiting behavior I would like to understand
I have a MySQL database that I am keeping temperature readings from several different
I have a mysql database that is tracking hockey stats. What I'd like to
I have a mysql database that looks like this: |id | city | created
I have a folder with backups from a MySQL database that are created automatically.
I have a MySQL database that has a few very simple tables. I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.