Bluehost.com Web Hosting $6.95

Trouble creating a table

This is a discussion on Trouble creating a table within the MySQL Database forums, part of the Database Forums category; Hi, This statement works fine on my MySQL 5.0 dev machine, but on my hosting environment, this statement CREATE ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-13-2007
laredotornado@zipmail.com
 
Posts: n/a
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: Documentation
#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

Reply With Quote
  #2 (permalink)  
Old 04-13-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Trouble creating a table

laredotornado@zipmail.com wrote:
> 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: Documentation
> #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
>


Dave,

What does SHOW INNODB STATUS tell you after this error?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #3 (permalink)  
Old 04-13-2007
laredotornado@zipmail.com
 
Posts: n/a
Default Re: Trouble creating a table

On Apr 13, 3:13 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> laredotorn...@zipmail.com wrote:
> > 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: Documentation
> > #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

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



My hosting company denies me this privilege:

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

- Dave

Reply With Quote
  #4 (permalink)  
Old 04-14-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Trouble creating a table

laredotornado@zipmail.com wrote:
> On Apr 13, 3:13 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> laredotorn...@zipmail.com wrote:
>>> 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: Documentation
>>> #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

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

>
>
> My hosting company denies me this privilege:
>
> #1227 - Access denied. You need the SUPER privilege for this
> operation
>
> - Dave
>


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.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0