4 messages in com.mysql.lists.plusplusRE: primary key?
FromSent OnAttachments
Lisa N. Michaud18 Apr 2004 12:59 
Gregory Haley18 Apr 2004 14:17 
Lisa N. Michaud18 Apr 2004 14:20 
Paolo Brandoli19 Apr 2004 00:08 
Subject:RE: primary key?
From:Gregory Haley (gha@venaca.com)
Date:04/18/2004 02:17:21 PM
List:com.mysql.lists.plusplus

Hi,

If you are using a unix system, from the command line you can type the following:

$ mysqldump -d dbase_name table_name

You will see all the column definitions, then the last line defining the columns you should see something like:

PRIMARY KEY (column_1,column_2)

where TABLE_ID is the name of your primary key column. if you have a multiple primary key, each column that makes up the key will be listed separated by commas.

also, if you are in a mysql session, if you describe your table, the primary keys will be listed as follows:

| column_1 | int(11) | | PRI | 0 | | | column_2 | int(11) | | PRI | 0 | |

hope this helps.

ciao! greg.

-----Original Message----- From: Lisa N. Michaud [mailto:lmic@wheatoncollege.edu] Sent: Sunday, April 18, 2004 4:00 PM To: plus@lists.mysql.com Subject: primary key?

Trying to look this up, but need the answer quick and you folk may be a faster resource -

Is there a quick way to determine what field(s) is/are serving as the primary key for a given table?

--lisa