• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Three problems with mysql...

 
Raghavan Chockalingam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. You can see the error coming up when I try to delete the column which is a primary key.


2. I am not able to add foreign key after creating table



I am posting all the problems in a single topic because all are related
Problem 3: Unable to drop a foreign key on a table


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raghavan,
It looks like something with the tablespace. Check if you have any locks on the tables and that there is enough memory on the machine.
 
Raghavan Chockalingam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have run queries at the end of the output to show you that no locks exist. I want to know how to do two things...
1. Find and list the entries in the table where indexes are stored
2. How to list all the tables created by an user?
 
Ben Ethridge
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MySql, I had the same problem as this thread starter. What solved it for me was including the database name, i.e, for example:

alter table myDb.studentscores_tbl drop foreign key studentid;

A clue is in the:

"Error on rename of '.\test\studentscores_tbl' to '.\test\#sql2-68c-1fe' (errno: 152)"

There is no database name ahead of the "."'s.

Hope that solves your problem as well.

Ben
 
OddThomas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding the third point, I was getting the same issue (errno 152) attempting to drop a foreign key using the MySQL Query Browser, even adding the schema at the front of the table. When I re-connected without specifying a default schema to connect to, the ALTER TABLE <schema>.<tablename> DROP FOREIGN KEY <fk> command worked fine.

Hope this is useful.

[ February 08, 2006: Message edited by: OddThomas ]
[ February 08, 2006: Message edited by: OddThomas ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "OddThomas"-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

Enyoy your time here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic