问题
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;
- Select a database.
- Select designer.
- Select 'Set Relation'
- Select a primary key
- Select a coresponding foriegn key
- Approve confirmation
Expected results; (and what I usually get)
A relationship is setup. A line connecting two keys.
Actual results;
- a green label "Loading 99%" appears in upper right corner.
- a second window pops up
http://localhost/phpmyadmin/pmd_general.php?db=jobhunt&server=1&token=d8235.....
- 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