MySQL查询和修改auto_increment的方法
- 查询表名为tableName的auto_increment值:
- 复制代码 代码如下:
- SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_schema='photos' and table_name="tableName";
- table_schema='photos' ---- 为所在数据库名称,没有这个会把root中所有表格中表格名都为tableName的auto_increment 都调出来;
- information_schema.tables 为固定的格式,sql进入命令终端----进入数据库中操作的内容;
- 修改 test_user 库 user 表 auto_increment为
- mysql> alter table test_user.user auto_increment=10000;
Query OK, 0 rows affected (0.12 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> 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)
- 修改 photos 库 tf_user 表 auto_increment为
mysql> alter table `photos`.`tf_user` auto_increment=20;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> select auto_increment from information_schema.tables where table_schema='photos' and table_name='tf_user';
+----------------+
| auto_increment |
+----------------+
| 20 |
+----------------+
1 row in set (0.00 sec)
- 也可以在表格的 操作 中 查看 修改 下一个插入数据的 AUTO_INCREMENT;---这样比较方便
- http://blog.csdn.net/fdipzone/article/details/50421831
MySQL查询和修改auto_increment的方法的更多相关文章
- MySQL auto_increment介绍 以及 查询和修改auto_increment的方法
一.auto_increment使用方法 .创建table时设置auto_increment属性和初始值100 create table nonove ( id bigint unsigned not ...
- MySql查看与修改auto_increment方法(转)
add by zhj: 在创建表时,如果没有显式的指定AUTO_INCREMENT的值,那它默认是1 原文:https://blog.csdn.net/fdipzone/article/detail ...
- MySQL查询出错提示 --secure-file-priv解决方法
原文 在某台DB上准备运行一个SQL语句,就是用SELECT INTO OUTFILE把查询结果写入到文件的时候提示以下信息: The MySQL server is running with the ...
- mysql查询表里的重复数据方法:
INSERT INTO hk_test(username, passwd) VALUES ('qmf1', 'qmf1'),('qmf2', 'qmf11') delete from hk_test ...
- Java如何连接SQLServer,并实现查询、修改、删除方法
场景:A:在UI自动化时,删除数据时候,在界面UI提示“该XX已被使用,无法删除”. 这时候我们有需要做数据初始化的操作,需要把历史数据做删除,来确脚本运行的重复执行,和稳定性质. B: 在做新增操作 ...
- MySQL查看和修改字符集的方法
一.查看字符集 1.查看MYSQL数据库服务器和数据库字符集 方法一:show variables like '%character%';方法二:show variables like 'collat ...
- linux通过命令行查看MySQL编码并修改-简洁版方法
云服务器环境:CentOS 7.4 因为服务器配置较低,故使用MySQL5.5 未进行设置前 1.查看字符编码: mysql> show variables like '%character%' ...
- mysql查询记录修改时间于现在大于30分钟
(unix_timestamp(now())-`updatetime`)>1800
- mysql查询表里的重复数据方法
select username,count(*) as count from hk_test group by username having count>1;
随机推荐
- Digital Roots:高精度
C - Digital Roots Description The digital root of a positive integer is found by summing the digits ...
- Python os.makedirs() 方法
os.makedirs() 方法用于递归创建目录.像 mkdir(), 但创建的所有intermediate-level文件夹需要包含子目录. 语法 makedirs()方法语法格式如下: os.ma ...
- springmvc 静态资源 配置
SpringMVC提供<mvc:resources>来设置静态资源,但是增加该设置如果采用通配符的方式增加拦截器的话仍然会被拦截器拦截,可采用如下方案进行解决: 方案一.拦截器中增加针对静 ...
- Scrum立会报告+燃尽图(十一月十五日总第二十三次):代码规范与技术交流
此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2384 项目地址:https://git.coding.net/zhang ...
- 软工1816 · Alpha冲刺(5/10)
团队信息 队名:爸爸饿了 组长博客:here 作业博客:here 组员情况 组员1(组长):王彬 过去两天完成了哪些任务 后端代码复审 福大各个食堂的菜品口味量化.属性标记 组织前后端线下协作 接下来 ...
- Python学习 - 入门篇2(更新中)
前言 学习渠道:慕课网:Python进阶 记录原因:我只是想边上课边做笔记而已,呵呵哒 食用提示:教程环境基于Python 2.x,有些内容在Python 3.x中已经改变 函数式编程 定义:一种抽象 ...
- 解决:Invalid character found in the request target.The valid characters are defined in RFC 7230 and RFC3986
目录 背景 原因分析 处理方法 参考 背景 在将tomcat升级到7.0.81版后,发现系统的有些功能不能使用了,查询日志发现是有些地址直接被tomcat认为存在不合法字符,返回HTTP 400错误响 ...
- ci事务
CI框架百问百答:CodeIgniter的事务用法?--第9问 时间 2013-06-06 10:57:45 CSDN博客 原文 http://blog.csdn.net/haor2756/art ...
- 微信Web开发者工具-下载、安装和使用图解
开发和测试小程序,需要借助微信官方提供的微信Web开发者工具进行预览和调试代码,从下载安装到使用,大致的流程如下: 1.下载安装包 下载地址传送门:https://developers.weixin. ...
- IIS部署时failed to execute url 解决方法
web.config中增加如下节点: <system.webServer> <validation validateIntegratedModeConfiguration=&quo ...