Relationship issue in the MySql designer

允我心安 提交于 2019-12-11 02:45:29

问题


Normally I have no issue with MySQL's PHPmyadmin designer to create referential integrity relations.

All of a sudden, I now get a 99% Loading in my browser window, and a popup php.

Reproduce;

  1. Select a database.
  2. Select designer.
  3. Select 'Set Relation'
  4. Select a primary key
  5. Select a coresponding foriegn key
  6. Approve confirmation

Expected results; (and what I usually get)

A relationship is setup. A line connecting two keys.

Actual results;

  1. a green label "Loading 99%" appears in upper right corner.
  2. a second window pops up http://localhost/phpmyadmin/pmd_general.php?db=jobhunt&server=1&token=d8235.....
  3. Relationship does not occur.

Is anyone else getting this?


回答1:


Yep, it was happening with me too. I've made some attempts here and discovered that the error of the blank pop-up occurs because I was trying to make a relationship with a foreign key that has no index set up.

Create an index for the future foreign key column and that may resolve.

Pay attention that when you try to make the relation without the index, the confirm box that appears has just a "Ok" and "Cancel" button, while when you already have the index, it permits you to set up the behaviors on delete and on update.




回答2:


[Solved] Just update Java for Windows plugin for your browser (Firefox, Chrome...) Go to Java site and update Java Firefox plugin.

One more solution is install and use SQLyog;




回答3:


While I still do not know why the interface decided to break but an add Forien Key works fine.

ALTER TABLE tableblah   
add FOREIGN KEY FCK2-BLAH ([Foreign-Key column]) REFERENCES [primary key table]([primary key column]);



回答4:


This method works for me:
1. Select table and click on Operations.
2. Change Storage Engine in table option to InnoDB.
3. Hit "Go" button.
Now, you can add foreign key by adding INDEX on column.



来源:https://stackoverflow.com/questions/8291915/relationship-issue-in-the-mysql-designer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!