Codeigniter远程phpmyadmin muti数据库未连接

时间:2018-11-23 07:31:53

标签: php mysql mysqli codeigniter-3 localserver

我正在创建CRM Webportal,并且正在使用Codeigniter(版本:3.05)。我想连接两个数据库(本地服务器的数据库和实时网络服务器的其他数据库,我已将我的IP地址添加到Remort-Mysql访问中,但未连接。它说

Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Filename: mysqli/mysqli_driver.php

请说明如何解决此问题。

请注意,我正在使用共享主机。

$active_group = 'default';
$active_group = 'server';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'xxxx',
    'database' => 'crm',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);
$db['server'] = array(
    'dsn'   => '',
    'hostname' => 'maalai.com',
    'username' => 'xxxxx',
    'password' => 'xxxxxx',
    'database' => 'datab',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => TRUE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

0 个答案:

没有答案