I create mysql event script with the aim to create mysql tables automatically every month. I want the name of the tables based on the current month and year. How do I do that?
I am trying this:
CREATE DEFINER = `root`@`localhost` EVENT `event_name`
ON SCHEDULE EVERY 1 MONTH
ON COMPLETION NOT PRESERVE ENABLE
DO
CREATE TABLE IF NOT EXISTS `currentMonth_currentYear_tableName` (
`column1` INT( 11 ) NOT NULL ,
`column2` DATETIME NOT NULL ,
`column3` DECIMAL( 10, 1 ) NOT NULL ,
PRIMARY KEY ( `column1` )
) ENGINE = INNODB DEFAULT CHARSET = utf8