当前位置:Gxlcms > 数据库问题 > mysql 批量更新数据库主键为int,bigint 类型,字段为自增类型

mysql 批量更新数据库主键为int,bigint 类型,字段为自增类型

时间:2021-07-01 10:21:17 帮助过:7人阅读

table_name, concat(‘alter table `‘,table_name,‘` MODIFY ‘, column_name, ‘ ‘, data_type ,‘ auto_increment;‘) as ‘query script‘ from information_schema.columns c where c.table_schema = ‘pv_2‘ and c.column_key =‘PRI‘ and c.data_type in ( ‘int‘,‘bigint‘) and c.extra <> ‘auto_increment‘ order by table_name;

 

mysql 批量更新数据库主键为int,bigint 类型,字段为自增类型

标签:sch   lte   post   orm   sel   blog   key   cat   from   

人气教程排行