• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Three problems with mysql...

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic