表的基本数据是存放在mysql的information_schema库的tables表中,我们可以使用sql查出。
select auto_increment from information_schema.tables where table_schema='db name' and table_name='table name';
例子:查看 test_user 库的 user 表 auto_increment
mysql> select auto_increment from information_schema.tables where table_schema='test_user' and table_name='user'; +----------------+| auto_increment | +----------------+| 1002 | +----------------+1 row in set (0.04 sec)
alter table tablename auto_increment=NUMBER;
例子:修改 test_user 库 user 表 auto_increment为 10000
mysql> alter table test_user.user auto_increment=10000; Query OK, 0 rows affected (0.12 sec) Records: 0 Duplicates: 0 Warnings: 0mysql> select auto_increment from information_schema.tables where table_schema='test_user' and table_name='user'; +----------------+| auto_increment | +----------------+| 10000 | +----------------+1 row in set (0.04 sec)
本文讲解了通过MySql查看与修改auto_increment的方法,更多相关内容请关注Gxl网。
相关推荐:
如何通过php生成网页桌面的快捷方式
利用js遍历获取表格内数据的方法
如何实现php 数组元素快速去重效果
Copyright © 2019- cepb.cn 版权所有 湘ICP备2022005869号-7
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务