Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MySQL Workbench - drawing 1:n relationships on model diagram

Posted on 2015-02-14
4
Medium Priority
?
157 Views
Last Modified: 2015-07-22
In the graphical display of tables and fields,
When i add a       1-to-many    relationship,      it does draw the line between the two tables,
but    (in Connect to Columns mode)   it adds a new field instead of using the foreign key already there which i had defined.

How can i connect from a specific EXISTING field (foreign index)  (on the "many" end of the arrow)  (which my naming convention uses, ColorID)   instead of having it add a new field in the table
tblColors_ID.

I'm also open to learn of tools other than WorkBench that can display/manipulate schema graphical diagrams.
I had used  FlashMySQLAdmin for years (albeit a few bugs, but workable and great looking results), which had a very nice graphical table interface and relationship editing interface, but alas it is no longer supported (PHP4, etc.).  (Someone should take it on and update it and sell it, quite a useful tool)

my example from above....

tblProducts            tblColors
ID                             ID
ColorID                   ColorName
0
Comment
Question by:willsherwood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Evan Cutler earned 2000 total points
ID: 40892813
When working with MYSQL  workbench,  on the diagram toolbar, look for the 1-n icon that has the eyedropper.  It will have the ability to select FK columns and PK columns referring to them.  

When you click the 1-n icon with the eyedropper, a black dialog box will appear asking for you to select the FK then the PK.

Hope this helps
0
 

Author Comment

by:willsherwood
ID: 40893361
thanks for this help!
it explains the eyedropper.
when i do this, indeed i can individually select the fields to specify the exact field
(it seems to want the primary key first then the usage of it as a FK)
however,  the resulting graphics shows only table to table.
it does not point field to field.
i had been spoiled by another tool (now defunct)  which
has the lines pointing specifically to the fields within each table  (not just a somewhat random placement to the edge of the table)
any thoughts?
0
 
LVL 9

Assisted Solution

by:Evan Cutler
Evan Cutler earned 2000 total points
ID: 40893624
Try this:In the main menu bar go to: Model -> Relationship Notation -> Connect to columns.
0
 

Author Closing Comment

by:willsherwood
ID: 40893661
excellent - the combination of these two tips is the solution!!

THANK YOU!
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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 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