SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Editing MySQL

  1. #1
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Eugene, OR
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you try looking at this section of the mysql manual from www.mysql.com
    http://www.mysql.com/documentation/m...on=ALTER_TABLE

    It discusses how to use the ALTER TABLE command.

    Take Care,

    Adam

  2. #2
    SitePoint Member
    Join Date
    May 2000
    Location
    Virginia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have created an MySQL database and in one of the tables I have two fields that are CHAR with a limit set to 50. I want to change the limit of the two fields to 100 without disturbing the entire database. Is there a way to change those two fields? I have read everythign I have and can't find out how to do that!

    Thanks for any help.

    Tom

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is also covered in my tutorial series. Basically, however, here's the command you'll need:

    ALTER TABLE <TableName> CHANGE COLUMN <OldColumName> <NewColumDeclaration>

    So, for example, to change column "SomeChars" of type VARCHAR(10) in table "MyTable" so that it contains 255 characters, you can do the following:

    ALTER TABLE MyTable CHANGE COLUMN SomeChars SomeChars VARCHAR(255);

    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!

  4. #4
    SitePoint Member
    Join Date
    May 2000
    Location
    Virginia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you! I found it in the tutorial and it worked great!

    Have a great day!

    Tom


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •