0
CREATE TABLE uhc
(
    id_uhc      int         not null        AUTO_INCREMENT,
    maxplayers  smallint    not null        DEFAULT 80,
    tostimc     bit(1)      not null        DEFAULT 1,  
    nether      bit(1)      not null        DEFAULT 0,
    host_name   varchar(20) not null,
primary key (id_uhc) );

1005 - Can't create table 'tostimc.uhc' (errno: 150)

The only thing I have is a primary key which in my opinion can't be wrong. I did have the table before with a foreign key in it but I dropped that one. (SHOW TABLES doesnt show the table neither)

REPAIR TABLE uhc:

Table 'tostimc.uhc' doesn't exist

DROP TABLE uhc:

1051 - Unknown table 'uhc'

The query works fine on a fresh database it just doesnt work on the production database we have, worth mentioning: We had the table with a foreign key in it but we dropped that one... I just cant find out what I'm doing wrong, could someone please help me, thanks!

Bram
  • 97
  • 8
  • In sqlfiddle it works fine. – Jens Mar 12 '15 at 19:32
  • On a fresh database it works fine but not on my database, that's the weird thing. I will add some info right now to the question. – Bram Mar 12 '15 at 19:33
  • are there any Problem with space on your machine? – Jens Mar 12 '15 at 19:34
  • Possible duplicate of: http://stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150 – Paul Griffin Mar 12 '15 at 19:35
  • Paul Griffin it's not a duplicate of that topic, there are alot of errno 150 topic but the problem with my query is that Im not using foreign key's. – Bram Mar 12 '15 at 19:53
  • Jens there is more than enough space on the machine – Bram Mar 12 '15 at 19:53
  • Did you read the other post? According to the answer on that post, if your old table, which was dropped, had a foreign key, your new one has to have it, too or MySQL will throw the exact error you are getting. Sounds suspiciously similar to the problem you are having. Try creating your table with the foreign key, then dropping the FK after the table is created. – Paul Griffin Mar 12 '15 at 20:08
  • When I try to create the table how it was the error says: 1146 - Table 'tostimc.uhc' doesn't exist – Bram Mar 12 '15 at 20:26
  • Ok, at least we have tried that. I'm not trying to hassle you, just want to make sure we are trying possible solutions that have already been found ;] – Paul Griffin Mar 12 '15 at 20:49

0 Answers0