|
...
|
...
|
@@ -35,14 +35,14 @@ class ProjectServer |
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// 设置 database.connections.custom_mysql 配置
|
|
|
|
config(['database.connections.custom_mysql.host' => '127.0.0.1']);
|
|
|
|
config(['database.connections.custom_mysql.port' => '3306']);
|
|
|
|
config(['database.connections.custom_mysql.database' => 'gl_data_24']);
|
|
|
|
config(['database.connections.custom_mysql.username' => 'root']);
|
|
|
|
config(['database.connections.custom_mysql.password' => 'root']);
|
|
|
|
config(['database.connections.custom_mysql.host' => $project->mysqlConfig->host]);
|
|
|
|
config(['database.connections.custom_mysql.port' => $project->mysqlConfig->port]);
|
|
|
|
config(['database.connections.custom_mysql.database' => $project->databaseName()]);
|
|
|
|
config(['database.connections.custom_mysql.username' => $project->mysqlConfig->user]);
|
|
|
|
config(['database.connections.custom_mysql.password' => $project->mysqlConfig->password]);
|
|
|
|
|
|
|
|
//清除现有的数据库连接配置
|
|
|
|
DB::purge('custom');
|
|
|
|
DB::purge('custom_mysql');
|
|
|
|
//重连
|
|
|
|
DB::connection('custom_mysql')->reconnect();
|
|
|
|
|
...
|
...
|
|