refactor: Added config option for database port (#5517)

This commit is contained in:
David Bell
2017-01-27 23:16:04 +00:00
committed by Neil Lathwood
parent 46003a39b6
commit 5dd030f438
10 changed files with 23 additions and 17 deletions

View File

@@ -34,6 +34,9 @@ $config['db']['extension'] = 'mysqli';//mysql and mysqli available
// MySQL Debug level
$config['mysql_log_level'] = 'ERROR';
//MySQL port
$config['db_port'] = 3306;
// What is my own hostname (used to identify this host in its own database)
$config['own_hostname'] = 'localhost';

View File

@@ -97,7 +97,7 @@ if ($config['memcached']['enable'] === true) {
if (!module_selected('nodb', $init_modules)) {
// Connect to database
$database_link = mysqli_connect('p:' . $config['db_host'], $config['db_user'], $config['db_pass']);
$database_link = mysqli_connect('p:' . $config['db_host'], $config['db_user'], $config['db_pass'], null, $config['db_port']);
if (!$database_link) {
echo '<h2>MySQL Error</h2>';
echo mysqli_connect_error();