File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-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 port
32
+ */
33
+ 'port ' => env ('REMOTE_DATABASE_PORT ' , '3306 ' ),
34
+
30
35
/*
31
36
* Set the database name
32
37
*/
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public function handle(): bool
27
27
28
28
$ username = config ('dbsync.username ' );
29
29
$ database = config ('dbsync.database ' );
30
+ $ port = config ('dbsync.port ' );
30
31
$ password = config ('dbsync.password ' );
31
32
$ ignore = config ('dbsync.ignore ' );
32
33
$ ignoreTables = explode (', ' , $ ignore );
@@ -48,9 +49,9 @@ public function handle(): bool
48
49
}
49
50
50
51
if ($ useSsh === true ) {
51
- exec ("ssh $ sshUsername@ $ host -p $ sshPort mysqldump -u $ username -p $ password $ database $ ignoreString > $ fileName " , $ output );
52
+ exec ("ssh $ sshUsername@ $ host -p $ sshPort mysqldump --port $ port -u $ username -p $ password $ database $ ignoreString > $ fileName " , $ output );
52
53
} else {
53
- exec ("mysqldump -h $ host -u $ username -p $ password $ database $ ignoreString --column-statistics=0 > $ fileName " , $ output );
54
+ exec ("mysqldump -h $ host --port $ port -u $ username -p $ password $ database $ ignoreString --column-statistics=0 > $ fileName " , $ output );
54
55
}
55
56
56
57
$ this ->comment (implode (PHP_EOL , $ output ));
You can’t perform that action at this time.
0 commit comments