DataBase/Mysql
[MySQL] auto_increment 삭제, 초기화 (how to remove auto_increment in mysql)
작업중에 PK, auto_increment 속성을가진 컬럼을 제거 해달라고 한다 .. oracle에서는 SEQUENCE를 삭제하면 되지만 속성만 지우는 방법을 몰라서 mysql에서 삭제를 하려고하니 pk는 지울 수 없고 auto_increment를 제거해달라고 경고창이 뜬다 구글링 결과 alter table [테이블명] drop primary key, change [필드명] [필드명] [데이터타입(길이)] not null; 결과적으로 alter문으로 속성을 변경 해주면 되는것... #Auto_increment 초기화방법 alter table [테이블명] auto_increment=1; set @count =0; update [테이블명] set [필드명] = @count:=@count+1; 첫번째 라인은 ..