在application/extra目录下创建新的数据库配置文件,我创建的是fenguidatabase.php,里面结构和database.php保持一致。 在model文件里用 protected $connection = ‘fenguidatabase’; 连接新配置的数据库。