---
title: "MySql 时间间隔 与 当前时间5分钟之前"
author: "i380"
date: "2013-08-26T10:37:45Z"
tags: []
categories: ["数据库"]
slug: "mysql-5"
draft: false
lastmod: "2013-08-26T10:37:45Z"
id: 1930865
url: "https://i380.iteye.com/blog/1930865"
---

select * from tb\_user where signtime between date\_add(now(), interval - 5 minute) and now()

 

列出当前时间与5分钟之内的 用户记录 

 

其中 interval - 5 minute 为间隔时间 

now() 为数据库当前时间 

 

附录

今天在学习存储过程中 mysql 抛出如下异常

1436 - Thread stack overrun

解决方案

修改mysql 的配置文件 my.ini 

thread\_stack = 128K

可以将标红处的数值改大点