Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    20

    Default Can't Drop Tables In My Databases

    Need some help figuring out a problem one of my clients is having. Below is there issue. Any ideas?

    I created a new database and I can't seem to be able to drop any of the tables when I try to import an sql file.

    I tried to do both add a drop if exists line in my sql file as well as manually dropping the tables, but I ended up with the same results. I also tried my other databases and had the same problem.

    I get an error when doing this. The error is:

    #1217 - Cannot delete or update a parent row: a foreign key constraint fails

  2. #2
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    239

    Default

    Is not an hosting error. Actually, is a feature .. MySQL doesn't let you make changes in tables that are linked with a foreign key constraint. So, if they eant to delete a table, should first remove the key - but I don't see the point of keys in this case.

  3. #3
    Member
    Join Date
    Jan 2004
    Posts
    20

    Default

    Quote Originally Posted by d_t View Post
    Is not an hosting error. Actually, is a feature .. MySQL doesn't let you make changes in tables that are linked with a foreign key constraint. So, if they eant to delete a table, should first remove the key - but I don't see the point of keys in this case.
    Thanks for the info, however I replied to this client for some more information and this is what they gave me.

    I am not sure what more I can give you. In any of my databases I can't drop any tables, or rows, or whatever. Basically I can't delete anything in my databases.
    A few days ago, the server I am on just rebooted itself out of the blue. I contacted my Data center and they gave no good reason why. They said all looks good.

    My current top server admin is MIA and all of a sudden I'm having some issues that my level of knowledge prevents me from resolving.

    Is there any reliable sources out there that deal with cPanel servers? To go thru and ensure my server is on the up and up?

    Thanks again.

  4. #4
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    239

    Default

    Client can drop entire database if he likes that. Or, he can only drop foreign key then delete or update the table.

    I don't understand the second question. There are so many reasons for a server to crash. It can be a hardware problem or a software. Even a bad writter site/script can crash a server. If the provider told you there's no hardware problem, then you can check the server logs. cPanel allows you to install "Munin Service Monitor" from plugins section - is a nice monitorring program. Also, you can use an external service to monitor the server uptime (like alertra.com). If you think is a cPanel-related problem, you can open a ticket.

  5. #5
    Member
    Join Date
    Jan 2004
    Posts
    20

    Default

    Quote Originally Posted by d_t View Post
    Client can drop entire database if he likes that. Or, he can only drop foreign key then delete or update the table.

    I don't understand the second question. There are so many reasons for a server to crash. It can be a hardware problem or a software. Even a bad writter site/script can crash a server. If the provider told you there's no hardware problem, then you can check the server logs. cPanel allows you to install "Munin Service Monitor" from plugins section - is a nice monitorring program. Also, you can use an external service to monitor the server uptime (like alertra.com). If you think is a cPanel-related problem, you can open a ticket.
    Thanks for the reply...

    See your saying that my client can do whatever he wants with his databases...but the reality is...HE CANT.

    Do you have any suggestions on how to resolve this or are you just able to tell me it can be done.

    That's the whole point of this post, whenever he tries to do anything with deleting database/s or any of there respective functions, he cant.

    As for the second question, it was not a question it is a statement.

    The third question was in reference to cPanel server outside services, which you answered...thank you.

  6. #6
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    239

    Default

    This is documentation for foreign key:
    http://dev.mysql.com/doc/refman/5.0/...nstraints.html

    I search on google for your error message and found this sollution that will drop the database (should also work with tables)

    Code:
    SET FOREIGN_KEY_CHECKS=0;
    DROP DATABASE ...
    SET FOREIGN_KEY_CHECKS=1;
    Don't forget first to make a backup.

  7. #7
    Member
    Join Date
    Jan 2004
    Posts
    20

    Default

    I was able to have my server admin look into this briefly, but hes not able to resolve it at this time. Below is what he thinks the problem is, would anybody have any ideas?

    This is a strange error and is related to the InnoDB storage engine instead of the MyISAM engine your databases should be set to.

    Now this is just for this one client, I have not received any notices of this issue from any of the other 50 clients on this server.

Similar Threads & Tags
Similar threads

  1. acc termination doesn't drop databases
    By bmett in forum cPanel Developers
    Replies: 5
    Last Post: 12-15-2010, 05:55 PM
  2. How to optimize all tables in all databases
    By Silent Ninja in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-23-2008, 10:31 AM
  3. Advanced Guestbook creating databases with no tables ?
    By nyjimbo in forum cPanel Developers
    Replies: 1
    Last Post: 06-09-2008, 03:11 PM
  4. What Is This Small Drop Down?
    By anup123 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-01-2006, 01:52 AM
  5. Flush databases, hosts, tables
    By billau in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-29-2004, 03:48 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube