primary key:主键,又叫主键约束。
primary key在表中是唯一代表一条记录的。primary key可以是1列,或者多列组合而成的。
如何查看一个表的主键是什么,举个例子:
desc查看表的各个字段,Key字段标识为PRI,表示主键
show create table查看建表语句
从这里可以看到,mysql.user表是Host、User组合的主键。
所以在mysql.user表中,任意两行的Host,User两个字段必须完全不能一致。