Is there a value or command like DATETIME that I can use in a manual query to insert the current date and time?
INSERT INTO servers (
server_name, online_
Even though there are many accepted answers, I think this way is also possible:
Create your 'servers' table as following :
CREATE TABLE `servers`
(
id int(11) NOT NULL PRIMARY KEY auto_increment,
server_name varchar(45) NOT NULL,
online_status varchar(45) NOT NULL,
_exchange varchar(45) NOT NULL,
disk_space varchar(45) NOT NULL,
network_shares varchar(45) NOT NULL,
date_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
);
And your INSERT statement should be :
INSERT INTO servers (server_name, online_status, _exchange, disk_space, network_shares)
VALUES('m1', 'ONLINE', 'ONLINE', '100GB', 'ONLINE');
My Environment:
Core i3 Windows Laptop with 4GB RAM, and I did the above example on MySQL Workbench 6.2 (Version 6.2.5.0 Build 397 64 Bits)