---
title: "MySQL建表，设置字段自动获取当前时间"
author: "feifeiwoye"
date: "2015-06-17T09:37:05Z"
tags: ["sql语句", "数据库"]
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2015-06-17T09:37:05Z"
id: 2220242
url: "https://feifeiwoye.iteye.com/blog/2220242"
---

CREATE TABLE comment_user (
	user_account VARCHAR (60),
	user_name VARCHAR (60),
	<span style="color:red">comment_content VARCHAR (500),
	comment_time TIMESTAMP not NULL DEFAULT CURRENT_TIMESTAMP</span>
);