ThinkPHP5动态创建数据表方法:

public function ceshi(){
    $sql = "
    CREATE TABLE IF NOT EXISTS `think_test`(
    `id` int(8) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
      PRIMARY KEY (`id`)
    )
    ENGINE=MyISAM
    DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
    CHECKSUM=0
    ROW_FORMAT=DYNAMIC
    DELAY_KEY_WRITE=0"
    ;

    Db::execute($sql);
}

运行结果: