diff --git a/core-bundle/src/Resources/contao/controllers/BackendInstall.php b/core-bundle/src/Resources/contao/controllers/BackendInstall.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/controllers/BackendInstall.php
+++ b/core-bundle/src/Resources/contao/controllers/BackendInstall.php
@@ -454,6 +454,12 @@ class BackendInstall extends \Backend
 					continue;
 				}
 
+				// The port number must not be empty (see #7950)
+				if ($strKey == 'dbPort' && \Input::post($strKey, true) == '')
+				{
+					\Input::setPost($strKey, 3306);
+				}
+
 				\Config::persist($strKey, \Input::post($strKey, true));
 			}
[Core] Ensure that the database port is not empty (see #<I>).