File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 27
27
*/
28
28
'username ' => env ('REMOTE_DATABASE_USERNAME ' , '' ),
29
29
30
+ /*
31
+ * Database host (optional)
32
+ */
33
+ 'mysqlHostName ' => env ('REMOTE_DATABASE_MYSQL_HOSTNAME ' , 'localhost ' ),
34
+
30
35
/*
31
36
* Database port
32
37
*/
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ public function handle(): bool
20
20
return true ;
21
21
}
22
22
23
- $ host = config ('dbsync.host ' );
24
23
$ useSsh = config ('dbsync.useSsh ' );
25
24
$ sshUsername = config ('dbsync.sshUsername ' );
26
25
$ sshPort = config ('dbsync.sshPort ' );
26
+ $ host = config ('dbsync.host ' );
27
27
28
+ $ mysqlHostName = config ('dbsync.mysqlHostName ' );
28
29
$ username = config ('dbsync.username ' );
29
30
$ database = config ('dbsync.database ' );
30
31
$ port = config ('dbsync.port ' );
@@ -59,7 +60,8 @@ public function handle(): bool
59
60
}
60
61
61
62
if ($ useSsh === true ) {
62
- exec ("ssh $ sshUsername@ $ host -p $ sshPort mysqldump -P $ port -u $ username -p $ password $ database $ ignoreString > $ fileName " , $ output );
63
+ echo ($ mysqlHostName . PHP_EOL );
64
+ exec ("ssh $ sshUsername@ $ host -p $ sshPort mysqldump -P $ port -h $ mysqlHostName -u $ username -p $ password $ database $ ignoreString > $ fileName " , $ output );
63
65
} else {
64
66
exec ("mysqldump -h $ host -P $ port -u $ username -p $ password $ database $ ignoreString $ mysqldumpSkipTzUtc --column-statistics=0 > $ fileName " , $ output );
65
67
}
You can’t perform that action at this time.
0 commit comments