讓您全面了解并上手億速云產(chǎn)品
常見入門級使用教程
對外 API 開發(fā)文檔中心
您歷史提交的工單
您的每一條意見,我們都嚴謹處理
您的每一條建議,我們都認真對待
售前咨詢:400-100-2938
執(zhí)行如下命令,查看是否有無主鍵表。
select table_schema,table_name from information_schema.tables
where (table_schema,table_name) not in(
select distinct table_schema,table_name from information_schema.columns where COLUMN_KEY='PRI'
)
and table_schema not in (
'sys','mysql','information_schema','performance_schema'
);
執(zhí)行如下命令,查看參數(shù)implicit_primary_key的值是否為ON。
show global variables like 'implicit_primary_key';
執(zhí)行如下命令,修改無主鍵表。
alter table <表名> engine=innodb;
執(zhí)行如下SQL語句,為無主鍵表添加主鍵。
ALTER TABLE <表名> ADD PRIMARY KEY (<需要設為主鍵的列名>);
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權所有
廣州億速云計算有限公司 粵ICP備17096448號-1 粵公網(wǎng)安備 44010402001142號 增值電信業(yè)務經(jīng)營許可證編號:B1-20181529