• <i id='xYvkE'><tr id='xYvkE'><dt id='xYvkE'><q id='xYvkE'><span id='xYvkE'><b id='xYvkE'><form id='xYvkE'><ins id='xYvkE'></ins><ul id='xYvkE'></ul><sub id='xYvkE'></sub></form><legend id='xYvkE'></legend><bdo id='xYvkE'><pre id='xYvkE'><center id='xYvkE'></center></pre></bdo></b><th id='xYvkE'></th></span></q></dt></tr></i><div id='xYvkE'><tfoot id='xYvkE'></tfoot><dl id='xYvkE'><fieldset id='xYvkE'></fieldset></dl></div>

        <tfoot id='xYvkE'></tfoot>
      1. <small id='xYvkE'></small><noframes id='xYvkE'>

        • <bdo id='xYvkE'></bdo><ul id='xYvkE'></ul>
        <legend id='xYvkE'><style id='xYvkE'><dir id='xYvkE'><q id='xYvkE'></q></dir></style></legend>

      2. Codeigniter 连接到使用 centOS 和 mariadb 作为数据库管理的 SSH 服务器的可能设置是什么?

        时间:2024-08-09
        <legend id='1bNlv'><style id='1bNlv'><dir id='1bNlv'><q id='1bNlv'></q></dir></style></legend>

          • <tfoot id='1bNlv'></tfoot>
              <tbody id='1bNlv'></tbody>

                • <bdo id='1bNlv'></bdo><ul id='1bNlv'></ul>
                • <i id='1bNlv'><tr id='1bNlv'><dt id='1bNlv'><q id='1bNlv'><span id='1bNlv'><b id='1bNlv'><form id='1bNlv'><ins id='1bNlv'></ins><ul id='1bNlv'></ul><sub id='1bNlv'></sub></form><legend id='1bNlv'></legend><bdo id='1bNlv'><pre id='1bNlv'><center id='1bNlv'></center></pre></bdo></b><th id='1bNlv'></th></span></q></dt></tr></i><div id='1bNlv'><tfoot id='1bNlv'></tfoot><dl id='1bNlv'><fieldset id='1bNlv'></fieldset></dl></div>
                • <small id='1bNlv'></small><noframes id='1bNlv'>

                  本文介绍了Codeigniter 连接到使用 centOS 和 mariadb 作为数据库管理的 SSH 服务器的可能设置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用的服务器是ssh连接,由centOS运行,它使用LAMP作为平台.

                  The server I'm using is an ssh connection, which is ran by centOS, it uses LAMP as platform.

                  因为是centOS,mariadb是它唯一可用的数据库管理.我无法通过 sudo yum install mysql-server 命令安装 mysql.

                  Because it is centOS, mariadb is the only available database management for it. I cannot install mysql via sudo yum install mysql-server command.

                  我在本地使用 codeigniter 创建了一个项目.

                  I've created a project using codeigniter in my local.

                  我无法连接到数据库.错误给出如下:

                  I'm having trouble connecting to the database. The error gives like:

                  A PHP Error was encountered
                  
                  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
                  

                  我的 codeigniter 中的 db 设置是:

                  The db setting in my codeigniter is:

                  $active_group = 'default';
                  $query_builder = TRUE;
                  
                  $db['default'] = array(
                      'dsn'   => '',
                      'hostname' => '*server-ip-address*',
                      'port' => '*server-port-number*',
                      'username' => 'root',
                      'password' => 'root@999',
                      'database' => 'listingapp_db',
                      '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
                  );
                  

                  我只是想也许我的数据库设置有误.

                  I just thought that maybe my database setting is wrong.

                  这与 dbdriver 设置有关吗?我尝试将 mysqli 更改为 mariadb,仍然没有进展.

                  Has it something to matter with the dbdriver setting? I tried changing mysqli to mariadb, still no progress.

                  什么可能是可以与服务器的centOS mariadb 共同使用的有效设置?

                  What could possibly be the valid setting that could co-inside with the server's centOS, mariadb?

                  我尝试 sudo iptables -vnL 检查防火墙,结果如下:

                  I tried sudo iptables -vnL to check firewall and this is the result:

                  Chain INPUT (policy DROP 10924 packets, 630K bytes)
                   pkts bytes target     prot opt in     out     source               destination
                  40905 5353K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
                  1860K 2702M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
                      0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x3F/0x00
                      4   172 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp flags:!0x17/0x02 state NEW
                      0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x3F/0x3F
                    158  9480 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
                    445 28059 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
                     57  2800 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:2202
                  
                  Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
                   pkts bytes target     prot opt in     out     source               destination
                  
                  Chain OUTPUT (policy ACCEPT 1133K packets, 103M bytes)
                   pkts bytes target     prot opt in     out     source               destination
                  

                  推荐答案

                  我现在已经解决了我的问题.打开我使用的端口,然后在mysql中授予root用户权限.

                  I have now fixed my issue. It's a matter of opening the port I used then granting privilege to the root user in mysql.

                  这篇关于Codeigniter 连接到使用 centOS 和 mariadb 作为数据库管理的 SSH 服务器的可能设置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:不允许在文件中加载数据 MariaDB 下一篇:file_get_contents("php://input") 或 $HTTP_RAW_POST_

                  相关文章

                  1. <small id='zzF5C'></small><noframes id='zzF5C'>

                    <tfoot id='zzF5C'></tfoot>

                    <legend id='zzF5C'><style id='zzF5C'><dir id='zzF5C'><q id='zzF5C'></q></dir></style></legend>
                      <bdo id='zzF5C'></bdo><ul id='zzF5C'></ul>
                    1. <i id='zzF5C'><tr id='zzF5C'><dt id='zzF5C'><q id='zzF5C'><span id='zzF5C'><b id='zzF5C'><form id='zzF5C'><ins id='zzF5C'></ins><ul id='zzF5C'></ul><sub id='zzF5C'></sub></form><legend id='zzF5C'></legend><bdo id='zzF5C'><pre id='zzF5C'><center id='zzF5C'></center></pre></bdo></b><th id='zzF5C'></th></span></q></dt></tr></i><div id='zzF5C'><tfoot id='zzF5C'></tfoot><dl id='zzF5C'><fieldset id='zzF5C'></fieldset></dl></div>