How to name constraints in MySql?

1

I'm trying to name constraints in MySQL but without success, I'm doing it as follows:

create table if not exists pessoas
(
    id int auto_increment,
    nome varchar(30) not null,
    data_nascimento date,
    constraint pk_pessoa primary key(id)
) default charset = utf8;

When I run the command show create table pessoas my constraint is not defined and when I try to do alter table pessoas drop index pk_pessoa I get an error. Where am I going wrong?

    
asked by anonymous 19.08.2018 / 07:51

0 answers