I know that the example worked as decribed above, thank you for confirming it. :-)I have a problem understanding why MySQL is deleting a unique key instead of a primary key.
from Documentation: DROP PRIMARY KEY drops the primary index. If no such index exists, it drops the first UNIQUE index in the table.
When I do it then I get this:
mysql> desc uksample4; +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | id | int(11) | | UNI | 0 | | | name | char(30) | YES | | NULL | | | tel | char(20) | | PRI | | | +-------+----------+------+-----+---------+-------+ 3 rows in set (0.00 sec)
mysql> alter table uksample4 drop primary key ; Query OK, 0 rows affected (0.24 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> desc uksample4; +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | id | int(11) | | | 0 | | | name | char(30) | YES | | NULL | | | tel | char(20) | | PRI | | | +-------+----------+------+-----+---------+-------+ 3 rows in set (0.00 sec)
It deletes the unique key (id) instead of he primary key (tel).
Did I do something wrong ?
MySQL 4.0.14
Your example worked fine for me. Could you provide a test case?
My Question is, why would it not drop the primary key, but the unique key instead ??
if there is no primary key MySQL uses the first unique key as primary key, so i think MySQL thinks there is no primary key cause your first field is an unique key, so MySQL drops the first unique key it finds, a bug?
Which command would delete the primary key ?
try to drop the index by its name
-- Sebastian Mendel
www.sebastianmendel.de www.tekkno4u.de www.nofetish.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]