#创建表,添加自动更新时间字段

CREATE TABLE `windows` (

`item` varchar(255) DEFAULT NULL,

`updatetime` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

) #######ENGINE=InnoDB DEFAULT CHARSET=gbk;

#添加列

alter table windows add column value decimal(16,2) not null;

#添加自增长列

alter table windows add id int auto_increment primary key


#新建用户并授予相应权限

create user 'monitoruser'@'%' identified by 'EW.3!9zep5j';

grant select,insert,update,delete,create on monitor_data.* to monitoruser;

flush privileges;