From 0827b2337bc48dda1c70fc9df06a2056eabb4b65 Mon Sep 17 00:00:00 2001 From: printempw Date: Sat, 12 Mar 2016 16:46:26 +0800 Subject: [PATCH] added mysql port to configuration --- admin/install.php | 4 ++-- config.example.php | 3 +++ includes/Database.class.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/admin/install.php b/admin/install.php index 8b3234cf..cbc4bcd9 100644 --- a/admin/install.php +++ b/admin/install.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: printempw - * @Last Modified time: 2016-03-05 19:22:44 + * @Last Modified time: 2016-03-12 16:44:47 * * Create tables automatically */ @@ -15,7 +15,7 @@ header('Content-type: text/html; charset=utf-8'); echo ""; if (!file_exists("./install.lock")) { - $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWD, DB_NAME); + $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT); echo "

Blessing Skin Server 安装程序

"; diff --git a/config.example.php b/config.example.php index 1dddb726..0ac72c36 100644 --- a/config.example.php +++ b/config.example.php @@ -8,6 +8,9 @@ define('DB_USER', 'root'); /* MySQL 连接密码 */ define('DB_PASSWD', 'root'); +/* MySQL 端口,默认 3306 */ +define('DB_PORT', 3306); + /* MySQL 主机 */ define('DB_HOST', 'localhost'); diff --git a/includes/Database.class.php b/includes/Database.class.php index c030e0f3..29e4f603 100644 --- a/includes/Database.class.php +++ b/includes/Database.class.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-02-02 21:59:06 * @Last Modified by: printempw - * @Last Modified time: 2016-03-06 13:41:24 + * @Last Modified time: 2016-03-12 16:43:53 */ class Database @@ -15,7 +15,7 @@ class Database } public static function checkConfig() { - $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWD, DB_NAME); + $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT); if ($conn->connect_error) { Utils::raise(-1, "Can not connect to mysql, check if database info correct in config.php. ". $conn->connect_error);