如何添加删除级联和更新限制使用phpmyadmin?

时间:2021-11-10 18:45:30

I want to add 'On delete cascade and on update restrict' on foreign keys through phpmyadmin user Interface instead of executing query.

我想通过phpmyadmin用户界面添加'On delete cascade和On update limit ',而不是执行查询。

I generally use Heidisql control panel for doing these actions. And now I'm having hard time doing the same on phpmyadmin.

我通常使用Heidisql控制面板来执行这些操作。现在我很难在phpmyadmin上做同样的事情。

Any idea?

任何想法?

3 个解决方案

#1


35  

In the tab where you define the table structure, you get the list of columns and their properties and underneath that there should be a link "relation view", between "print view", and "propose table structure."

在定义表结构的选项卡中,您将获得列及其属性的列表,在其下面应该有一个链接“关系视图”,在“打印视图”和“建议表结构”之间。

That's where you want to go, but you have to have created the index on both tables already. Also, you might want to make sure you're using mysql's innoDB storage engine.

这就是您要去的地方,但是您必须已经在两个表上创建了索引。另外,您可能需要确保使用的是mysql的innoDB存储引擎。

Edit : An image is worth 1000 words : 如何添加删除级联和更新限制使用phpmyadmin?

编辑:图片值1000字:

#2


2  

Cimbali's answer worked for me, but things were placed a little differently, so in case you're also looking for the "relation view" link, try looking there: 如何添加删除级联和更新限制使用phpmyadmin?

Cimbali的回答对我来说是有效的,但是事情被放置的有点不同,所以如果你也在寻找“关系视图”链接,试着看看那里:

It should take you there:

它会带你到那里:

如何添加删除级联和更新限制使用phpmyadmin?

#3


1  

Key fact: 1. Both table must be have innodb storage engine. 2. The datatype and length should be same in both table. 3. The field in 2nd table should be created as index.

关键事实:1。两个表都必须具有innodb存储引擎。2。两个表中的数据类型和长度应该相同。3所示。应将表2中的字段创建为索引。

Hope it will help someone...

希望它能帮助某人……

#1


35  

In the tab where you define the table structure, you get the list of columns and their properties and underneath that there should be a link "relation view", between "print view", and "propose table structure."

在定义表结构的选项卡中,您将获得列及其属性的列表,在其下面应该有一个链接“关系视图”,在“打印视图”和“建议表结构”之间。

That's where you want to go, but you have to have created the index on both tables already. Also, you might want to make sure you're using mysql's innoDB storage engine.

这就是您要去的地方,但是您必须已经在两个表上创建了索引。另外,您可能需要确保使用的是mysql的innoDB存储引擎。

Edit : An image is worth 1000 words : 如何添加删除级联和更新限制使用phpmyadmin?

编辑:图片值1000字:

#2


2  

Cimbali's answer worked for me, but things were placed a little differently, so in case you're also looking for the "relation view" link, try looking there: 如何添加删除级联和更新限制使用phpmyadmin?

Cimbali的回答对我来说是有效的,但是事情被放置的有点不同,所以如果你也在寻找“关系视图”链接,试着看看那里:

It should take you there:

它会带你到那里:

如何添加删除级联和更新限制使用phpmyadmin?

#3


1  

Key fact: 1. Both table must be have innodb storage engine. 2. The datatype and length should be same in both table. 3. The field in 2nd table should be created as index.

关键事实:1。两个表都必须具有innodb存储引擎。2。两个表中的数据类型和长度应该相同。3所示。应将表2中的字段创建为索引。

Hope it will help someone...

希望它能帮助某人……