Professional Web Applications Themes

Trouble creating a table - MySQL

Hi, This statement works fine on my MySQL 5.0 dev machine, but on my hosting environment, this statement CREATE TABLE SCHOOL_LIST ( ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), STUDENT_ID VARCHAR(255), PRIMARY KEY (ID) ) TYPE = INNODB; INSERT INTO SCHOOL_LIST (FIRST_NAME, LAST_NAME, STUDENT_ID) VALUES ('Dave', 'Zzzzz', '3'), ('Jim', 'Bruno', '1'), ('Beau', 'Clark', '2'), ('Peter', 'Leighton', '10'), ('Tony', 'Lucki', '5'), ('Greg', 'Metz', '4'), ('Barry', 'O''Callaghan', '6'), ('Fiona', 'O''Carroll', '9'), ('Steve', 'Richards', '11'), ('Annette', 'Royal', '7'), ('Clarence', 'Slacker', '8'); CREATE TABLE CLASS_LIST ( ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, SCHOOL_LIST_ID INTEGER UNSIGNED NOT NULL, CONSTRAINT FK_CLASS_LIST FOREIGN KEY ...

  1. #1

    Default Trouble creating a table

    Hi, This statement works fine on my MySQL 5.0 dev machine, but on my
    hosting environment, this statement

    CREATE TABLE SCHOOL_LIST (
    ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    FIRST_NAME VARCHAR(255),
    LAST_NAME VARCHAR(255),
    STUDENT_ID VARCHAR(255),
    PRIMARY KEY (ID)
    ) TYPE = INNODB;
    INSERT INTO SCHOOL_LIST (FIRST_NAME, LAST_NAME, STUDENT_ID) VALUES
    ('Dave', 'Zzzzz', '3'), ('Jim', 'Bruno', '1'), ('Beau', 'Clark', '2'),
    ('Peter', 'Leighton', '10'), ('Tony', 'Lucki', '5'), ('Greg', 'Metz',
    '4'), ('Barry', 'O''Callaghan', '6'), ('Fiona', 'O''Carroll', '9'),
    ('Steve', 'Richards', '11'), ('Annette', 'Royal', '7'), ('Clarence',
    'Slacker', '8');
    CREATE TABLE CLASS_LIST (
    ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    SCHOOL_LIST_ID INTEGER UNSIGNED NOT NULL,
    CONSTRAINT FK_CLASS_LIST FOREIGN KEY (SCHOOL_LIST_ID)
    REFERENCES SCHOOL_LIST(ID),
    PRIMARY KEY (ID)
    ) TYPE = INNODB;

    gives this error

    MySQL said: Doentation
    #1005 - Can't create table './hmco/CLASS_LIST.frm' (errno: 150)

    How can I rewrite the CLASS_LIST table creation statement to make this
    work?

    Thanks, - Dave

    laredotornado@zipmail.com Guest

  2. #2

    Default Re: Trouble creating a table

    com wrote: 

    Dave,

    What does SHOW INNODB STATUS tell you after this error?

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: Trouble creating a table

    On Apr 13, 3:13 pm, Jerry Stuckle <net> wrote: 





    >
    > Dave,
    >
    > What does SHOW INNODB STATUS tell you after this error?
    >
    > --
    > ==================
    > Remove the "x" from my email address
    > Jerry Stuckle
    > JDS Computer Training Corp.
    > net
    > ==================[/ref]


    My hosting company denies me this privilege:

    #1227 - Access denied. You need the SUPER privilege for this
    operation

    - Dave

    laredotornado@zipmail.com Guest

  4. #4

    Default Re: Trouble creating a table

    com wrote: 
    >> Dave,
    >>
    >> What does SHOW INNODB STATUS tell you after this error?
    >>
    >> --
    >> ==================
    >> Remove the "x" from my email address
    >> Jerry Stuckle
    >> JDS Computer Training Corp.
    >> net
    >> ==================[/ref]
    >
    >
    > My hosting company denies me this privilege:
    >
    > #1227 - Access denied. You need the SUPER privilege for this
    > operation
    >
    > - Dave
    >[/ref]

    Dave,

    It's pretty much of a guess, then. Without the ability to see what
    INNODB is complaining about there's little way to tell what the problem
    is, especially since it's working on your other system.

    Maybe a version difference? Don't know.

    But I do wonder why you would have a table with only an id and a foreign
    key column...
    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

Similar Threads

  1. Replies: 8
    Last Post: January 26th, 05:01 PM
  2. table trouble
    By xsyst3m0v3rl0adx in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: September 2nd, 12:49 AM
  3. Trouble copying data from old table to new table
    By RelentlessMike in forum Coldfusion Database Access
    Replies: 3
    Last Post: May 19th, 05:01 PM
  4. Trouble creating a new .NET webservice
    By smile in forum ASP.NET Web Services
    Replies: 1
    Last Post: September 23rd, 02:16 PM
  5. Replies: 5
    Last Post: July 17th, 06:59 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139