added mysql port to configuration
This commit is contained in:
parent
ac8ae16786
commit
0827b2337b
|
|
@ -3,7 +3,7 @@
|
||||||
* @Author: printempw
|
* @Author: printempw
|
||||||
* @Date: 2016-01-16 23:01:33
|
* @Date: 2016-01-16 23:01:33
|
||||||
* @Last Modified by: printempw
|
* @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
|
* Create tables automatically
|
||||||
*/
|
*/
|
||||||
|
|
@ -15,7 +15,7 @@ header('Content-type: text/html; charset=utf-8');
|
||||||
echo "<style>body { font-family: Courier, 'Microsoft Yahei', 'Microsoft Jhenghei', sans-serif; }</style>";
|
echo "<style>body { font-family: Courier, 'Microsoft Yahei', 'Microsoft Jhenghei', sans-serif; }</style>";
|
||||||
|
|
||||||
if (!file_exists("./install.lock")) {
|
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 "<h2>Blessing Skin Server 安装程序</h2>";
|
echo "<h2>Blessing Skin Server 安装程序</h2>";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ define('DB_USER', 'root');
|
||||||
/* MySQL 连接密码 */
|
/* MySQL 连接密码 */
|
||||||
define('DB_PASSWD', 'root');
|
define('DB_PASSWD', 'root');
|
||||||
|
|
||||||
|
/* MySQL 端口,默认 3306 */
|
||||||
|
define('DB_PORT', 3306);
|
||||||
|
|
||||||
/* MySQL 主机 */
|
/* MySQL 主机 */
|
||||||
define('DB_HOST', 'localhost');
|
define('DB_HOST', 'localhost');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* @Author: printempw
|
* @Author: printempw
|
||||||
* @Date: 2016-02-02 21:59:06
|
* @Date: 2016-02-02 21:59:06
|
||||||
* @Last Modified by: printempw
|
* @Last Modified by: printempw
|
||||||
* @Last Modified time: 2016-03-06 13:41:24
|
* @Last Modified time: 2016-03-12 16:43:53
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Database
|
class Database
|
||||||
|
|
@ -15,7 +15,7 @@ class Database
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function checkConfig() {
|
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) {
|
if ($conn->connect_error) {
|
||||||
Utils::raise(-1, "Can not connect to mysql, check if database info correct in config.php. ".
|
Utils::raise(-1, "Can not connect to mysql, check if database info correct in config.php. ".
|
||||||
$conn->connect_error);
|
$conn->connect_error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user