用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1774|回复: 0
收起左侧

[HELP] 求助新浪云数据库连接问题

[复制链接]
发表于 2015-12-24 19:35:47 | 显示全部楼层 |阅读模式
新手连接数据库,出现了3个问题
A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect() expects parameter 5 to be long, string given

Filename: mysqli/mysqli_driver.php

Line Number: 161
161 行代码如下:
if ($mysqli->real_connect($hostname, $this->username, $this->password, $this->database, $port, $socket, $client_flags))
                {
                        // Prior to version 5.7.3, MySQL silently downgrades to an unencrypted connection if SSL setup fail

Backtrace:

File: /data1/www/htdocs/975/malxi/1/index.php
Line: 292
代码如下:
require_once BASEPATH.'core/CodeIgniter.php';
Function: require_once


A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /data1/www/htdocs/975/malxi/1/system/core/Exceptions.php:272)

Filename: core/Common.php

Line Number: 573
代码如下:
{
                        $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
                        header($server_protocol.' '.$code.' '.$text, TRUE, $code);
                }
Backtrace:

File: /data1/www/htdocs/975/malxi/1/index.php
Line: 292
代码如下:
require_once BASEPATH.'core/CodeIgniter.php';
Function: require_once


A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/CodeIgniter.php

Line Number: 500
代码如下:
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');

        $CI = new $class();

还有database配置;
$db['default'] = array(
        'dsn'        => '',
        'hostname' => 'SAE_MYSQL_HOST_M',
        'username' => 'SAE_MYSQL_USER',
        'password' => 'SAE_MYSQL_PASS',
        'database' => 'SAE_MYSQL_DB',
        'dbdriver' => 'mysqli',
        'dbprefix' => '',
        'pconnect' => FALSE,
        'db_debug' => TRUE,
        'cache_on' => FALSE,
        'cachedir' => '',
        'char_set' => 'utf8',
        'dbcollat' => 'utf8_general_ci',
        'swap_pre' => '',
        'autoinit' => TRUE,
        'encrypt' => FALSE,
        'compress' => FALSE,
        'stricton' => FALSE,
        'failover' => array(),
        'save_queries' => TRUE,
        'port' => 'SAE_MYSQL_PORT'
);


求助,不知道怎么解决,谢谢!

本版积分规则