FAQ
I followed the instructions here to setup Hue on my cluster -
https://ccp.cloudera.com/display/FREE4DOC/Using+an+External+Database+for+Hue.

When I try to delete records from this table I get the foreign key
constraint error. Is this instruction wrong in this page? Are we suppose to
delete data from this table?

mysql> delete FROM hue.django_content_type;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
constraint fails (`hue`.`auth_permission`, CONSTRAINT
`content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`)
REFERENCES `django_content_type` (`id`))

Search Discussions

  • bc Wong at Oct 12, 2012 at 9:02 pm

    On Fri, Oct 12, 2012 at 11:19 AM, Mark wrote:

    I followed the instructions here to setup Hue on my cluster -
    https://ccp.cloudera.com/display/FREE4DOC/Using+an+External+Database+for+Hue
    .

    When I try to delete records from this table I get the foreign key
    constraint error. Is this instruction wrong in this page? Are we suppose to
    delete data from this table?

    mysql> delete FROM hue.django_content_type;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
    constraint fails (`hue`.`auth_permission`, CONSTRAINT
    `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`)
    REFERENCES `django_content_type` (`id`))
    It works for me. What mysql version are you using? Can you issue `show
    create table hue.auth_permission' and paste the result?

    Cheers,
    bc
  • Mark at Oct 14, 2012 at 7:57 pm
    mysql Ver 14.14 Distrib 5.5.24 - Is that the reason?

    Hue is working perfectly and all my setup worked fine but that last step
    failed with the Error I posted earlier. Should I be worried?

    mysql> show create table hue.auth_permission;
    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    Table | Create Table

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    auth_permission | CREATE TABLE `auth_permission` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `content_type_id` int(11) NOT NULL,
    `codename` varchar(100) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `content_type_id` (`content_type_id`,`codename`),
    KEY `auth_permission_e4470c6e` (`content_type_id`),
    CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY
    (`content_type_id`) REFERENCES `django_content_type` (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=latin1 |
    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    mysql> quit;
    Bye
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ which mysql
    /usr/bin/mysql
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ mysql --version
    mysql Ver 14.14 Distrib 5.5.24, for debian-linux-gnu (x86_64) using
    readline 6.2


    On Friday, October 12, 2012 1:57:13 PM UTC-7, bc Wong wrote:

    On Fri, Oct 12, 2012 at 11:19 AM, Mark <mark.go...@gmail.com <javascript:>
    wrote:
    I followed the instructions here to setup Hue on my cluster -
    https://ccp.cloudera.com/display/FREE4DOC/Using+an+External+Database+for+Hue
    .

    When I try to delete records from this table I get the foreign key
    constraint error. Is this instruction wrong in this page? Are we suppose to
    delete data from this table?

    mysql> delete FROM hue.django_content_type;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
    constraint fails (`hue`.`auth_permission`, CONSTRAINT
    `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`)
    REFERENCES `django_content_type` (`id`))
    It works for me. What mysql version are you using? Can you issue `show
    create table hue.auth_permission' and paste the result?

    Cheers,
    bc
  • bc Wong at Oct 14, 2012 at 9:34 pm

    On Sun, Oct 14, 2012 at 12:57 PM, Mark wrote:

    mysql Ver 14.14 Distrib 5.5.24 - Is that the reason?

    Hue is working perfectly and all my setup worked fine but that last step
    failed with the Error I posted earlier. Should I be worried?

    mysql> show create table hue.auth_permission;

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    Table | Create Table

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    auth_permission | CREATE TABLE `auth_permission` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `content_type_id` int(11) NOT NULL,
    `codename` varchar(100) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `content_type_id` (`content_type_id`,`codename`),
    KEY `auth_permission_e4470c6e` (`content_type_id`),

    CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY
    (`content_type_id`) REFERENCES `django_content_type` (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=latin1 |

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    mysql> quit;
    Bye
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ which mysql
    /usr/bin/mysql
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ mysql --version
    mysql Ver 14.14 Distrib 5.5.24, for debian-linux-gnu (x86_64) using
    readline 6.2
    Ah. It's innodb. Otherwise there won't be a FK constraint. You can first do
    a `alter table auth_permission drop foreign
    key content_type_id_refs_id_728de91f'. It's actually ok to drop the FK
    because that works for all other database types. And Hue's ORM layer takes
    care of actual consistency.

    Cheers,
    bc

    On Friday, October 12, 2012 1:57:13 PM UTC-7, bc Wong wrote:
    On Fri, Oct 12, 2012 at 11:19 AM, Mark wrote:

    I followed the instructions here to setup Hue on my cluster -
    https://ccp.cloudera.com/**display/FREE4DOC/Using+an+**
    External+Database+for+Hue<https://ccp.cloudera.com/display/FREE4DOC/Using+an+External+Database+for+Hue>
    .

    When I try to delete records from this table I get the foreign key
    constraint error. Is this instruction wrong in this page? Are we suppose to
    delete data from this table?

    mysql> delete FROM hue.django_content_type;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
    constraint fails (`hue`.`auth_permission`, CONSTRAINT
    `content_type_id_refs_id_**728de91f` FOREIGN KEY (`content_type_id`)
    REFERENCES `django_content_type` (`id`))
    It works for me. What mysql version are you using? Can you issue `show
    create table hue.auth_permission' and paste the result?

    Cheers,
    bc
  • Mark at Oct 24, 2012 at 7:03 am
    Thanks bc.
    On Sunday, October 14, 2012 2:27:55 PM UTC-7, bc Wong wrote:

    On Sun, Oct 14, 2012 at 12:57 PM, Mark <mark.go...@gmail.com <javascript:>
    wrote:
    mysql Ver 14.14 Distrib 5.5.24 - Is that the reason?

    Hue is working perfectly and all my setup worked fine but that last step
    failed with the Error I posted earlier. Should I be worried?

    mysql> show create table hue.auth_permission;

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    Table | Create Table

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    auth_permission | CREATE TABLE `auth_permission` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `content_type_id` int(11) NOT NULL,
    `codename` varchar(100) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `content_type_id` (`content_type_id`,`codename`),
    KEY `auth_permission_e4470c6e` (`content_type_id`),

    CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY
    (`content_type_id`) REFERENCES `django_content_type` (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=latin1 |

    +-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    mysql> quit;
    Bye
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ which mysql
    /usr/bin/mysql
    hdfs@ip-xx-xx-xx-xxx:/home/ubuntu$ mysql --version
    mysql Ver 14.14 Distrib 5.5.24, for debian-linux-gnu (x86_64) using
    readline 6.2
    Ah. It's innodb. Otherwise there won't be a FK constraint. You can first
    do a `alter table auth_permission drop foreign
    key content_type_id_refs_id_728de91f'. It's actually ok to drop the FK
    because that works for all other database types. And Hue's ORM layer takes
    care of actual consistency.

    Cheers,
    bc

    On Friday, October 12, 2012 1:57:13 PM UTC-7, bc Wong wrote:
    On Fri, Oct 12, 2012 at 11:19 AM, Mark wrote:

    I followed the instructions here to setup Hue on my cluster -
    https://ccp.cloudera.com/**display/FREE4DOC/Using+an+**
    External+Database+for+Hue<https://ccp.cloudera.com/display/FREE4DOC/Using+an+External+Database+for+Hue>
    .

    When I try to delete records from this table I get the foreign key
    constraint error. Is this instruction wrong in this page? Are we suppose to
    delete data from this table?

    mysql> delete FROM hue.django_content_type;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
    constraint fails (`hue`.`auth_permission`, CONSTRAINT
    `content_type_id_refs_id_**728de91f` FOREIGN KEY (`content_type_id`)
    REFERENCES `django_content_type` (`id`))
    It works for me. What mysql version are you using? Can you issue `show
    create table hue.auth_permission' and paste the result?

    Cheers,
    bc

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedOct 12, '12 at 8:59p
activeOct 24, '12 at 7:03a
posts5
users2
websitecloudera.com
irc#hadoop

2 users in discussion

Mark: 3 posts bc Wong: 2 posts

People

Translate

site design / logo © 2022 Grokbase