当前位置:网站首页>MySQL删除表后如何使ID从1开始
MySQL删除表后如何使ID从1开始
2022-06-27 20:25:00 【bksheng】
方法一:
# 删除
delete from 表名;
#设置成从1开始自增
ALTER TABLE 表名 AUTO_INCREMENT=1;
方法二:
#删除之前先执行删除外键约束
SET foreign_key_checks = 0;
#将数据全部删除,重新定位自增的字段
truncate table 表名;
#删除完之后再执行启动外键约束
SET foreign_key_checks = 1;
边栏推荐
- Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
- 初识C语言 第二弹
- Follow the archiving tutorial to learn rnaseq analysis (IV): QC method for de analysis using deseq2
- Livox lidar+apx15 real-time high-precision radar map reproduction and sorting
- Oracle obtains the beginning and end of the month time, and obtains the beginning and end of the previous month time
- [network] common request methods
- 九九乘法表——C语言
- Spark BUG实践(包含的BUG:ClassCastException;ConnectException;NoClassDefFoundError;RuntimeExceptio等。。。。)
- Hiplot 在線繪圖工具的本地運行/開發庫開源
- About the SQL injection of davwa, errors are reported: analysis and verification of the causes of legal mix of settlements for operation 'Union'
猜你喜欢

mysql操作入门(四)-----数据排序(升序、降序、多字段排序)

Livox lidar+ Hikvision camera real-time 3D reconstruction based on loam to generate RGB color point cloud

这类人开始被VC疯抢,月薪8万

SQL Server 2016详细安装教程(附注册码和资源)

MapReduce初级编程实践

各种loam总结(激光slam)

Netease cloud lost its "feelings" card

Introduction to MySQL operation (IV) -- data sorting (ascending, descending, and multi field sorting)

Penetration learning - shooting range chapter -dvwa shooting range detailed introduction (continuous updating - currently only the SQL injection part is updated)

Senior headhunting team manager: interviewed 3000 consultants, summarized and organized 8 commonalities (Mao Sheng)
随机推荐
Redis principle - string
Structured machine learning project (II) - machine learning strategy (2)
跟着存档教程动手学RNAseq分析(一)
[cloud based co creation] what is informatization? What is digitalization? What are the connections and differences between the two?
通过tidymodels使用XGBOOST
Go language slice vs array panic: runtime error: index out of range problem solving
[网络]常见的请求方法
Vue+mysql login registration case
改善深层神经网络:超参数调试、正则化以及优化(三)- 超参数调试、Batch正则化和程序框架
个人TREE ALV 模版-加快你的开发
Livox lidar+apx15 real-time high-precision radar map reproduction and sorting
结构化机器学习项目(一)- 机器学习策略
STM32与RC522简单公交卡系统的设计
Oracle obtains the beginning and end of the month time, and obtains the beginning and end of the previous month time
跟着存档教程动手学RNAseq分析(三):使用DESeq2进行计数标准化
Azure Kinect DK realizes 3D reconstruction (Jetson real-time version)
Transformation from student to engineer
量化交易入门教程
OData - SAP S4 OP 中使用SAP API Hub 的API
Hiplot 在线绘图工具的本地运行/开发库开源