沒半小時統(tǒng)計name的記錄數(shù)量
SELECT concat(substr(create_time,1,13),":",IF(substr(create_time,15,1)<'3',"00","30")) ,count(distinct name) as date FROM user group by date
修改MySQL的字符集
查看字符集命令
show variables like '%char%';
修改character_set_server字符串
vim /etc/mysql/mysql.conf.d/mysqld.cnf
#在[mysqld]下添加
character_set_server = utf8
sudo systemctl restart mysql.service
修改列名(列定義)
alter table user change u_time u_time DATETIME DEFAULT CURRENT_TIMESTAMP ON update CURRENT_TIMESTAMP COMMENT '修改日期';