Solved

index not defined error when creating foreign key

Posted on 2014-04-06
7
881 Views
Last Modified: 2014-04-16
I am managing mysql 5.6 with phpMyadmin 2.8.1 which are hosted by IPower (web hosting company).

I have created 2 tables and have set them up as InnoDB.

The tables created names are: users and patient_id.

In the patient_id table I have added a column to be used as the foreign key that will be related to the "id" column in the users table.

I have indexed this column in the patient_id table.

When I go into the relationship view of the table and try to setup the relationship , I get "No Index found for the column" even though I have indexed it already!

I have attached screenshots of the database structure and the error message.

Any help will be greatly appreciated! Thanks
Q-28406140.png
0
Comment
Question by:LuiLui77
  • 4
7 Comments
 

Author Comment

by:LuiLui77
ID: 39981516
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39982142
Can you post the designer view of your database?
You can get it by clicking on the database name on the left, then clicking on "Designer".
See image.
designer view
0
 
LVL 14

Expert Comment

by:dejaanbu
ID: 39982176
this may help

detailed info
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:LuiLui77
ID: 39983526
I don't have Designer available on phpMyadmin, so I had to draw it in excel en posted it as a picture.
Tables-relationship.png
0
 

Accepted Solution

by:
LuiLui77 earned 0 total points
ID: 39994337
I ended up on creating the tables on a test mysql server and setting up the relationship, then I exported the database and imported it into the production server. Now the tables are related.

Thank you.
0
 

Author Closing Comment

by:LuiLui77
ID: 40003497
Not a real solution but a good workaround that fixed my issue.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question