Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8492369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:41:55+00:00 2026-06-10T22:41:55+00:00

I use MySQL 5.1. Have a table with 2 foreign keys, referencing 2 different

  • 0

I use MySQL 5.1. Have a table with 2 foreign keys, referencing 2 different tables:

CREATE TABLE `words` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `word` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `words_groups` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `words_in_group` (
  `group_id` int(10) unsigned DEFAULT NULL,
  `word_id` int(10) unsigned DEFAULT NULL,
  KEY `word_id` (`word_id`) USING BTREE,
  KEY `group_id` (`group_id`) USING BTREE,
  CONSTRAINT `group_id` FOREIGN KEY (`group_id`) REFERENCES `words_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `word_id_fk` FOREIGN KEY (`word_id`) REFERENCES `words` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

But for some reason the CASCADE property for one of the keys in words_in_group table is unset when I use phpMyAdmin or Navicat and check this table structure.

What can it be? How to solve? Maybe, use triggers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:41:57+00:00Added an answer on June 10, 2026 at 10:41 pm

    Test the cascade by inserting some test data, then deleting a row from words.

    You could also dump the database with mysqldump, and read what the database server thinks it’s supposed to do.

    I’m pretty sure you’ll find that the cascades work as written, not as shown in the graphical interfaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an h2 database with two tables with foreign keys like CREATE TABLE
I have a set of tables in MySQL like this (foreign keys referenced by
I have a remote mySQL table that I use in a few tools, occasionally
I'm reorganizing our MySQL database, changing MyISAM tables to InnoDB and setting foreign keys,
I have a schema that uses InnoDB table type and foreign keys. I am
Ok, so I am creating tables in MySQL with indexes and foreign keys. I
Trying to create a few new tables with foreign keys but am getting caught
I have this kind of table in my MySql Database : CREATE TABLE `forum_categories`
I have a table of the form CREATE TABLE data { pk INT PRIMARY
Our current database (MySQL) already has Indexes for its foreign keys since these use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.