Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Aug 2007
    Posts
    67
    Plugin Contributions
    0

    Default PHP Warning: mysqli_connect(): (28000/1045)

    Hello
    I am currently running a fresh install of 154 with the responsive_avonlee_contempo template. I have Image Handler installed and google site map. I am generating debug logs that read:

    Code:
    [22-Feb-2015 14:56:46 America/Denver] PHP Warning:  mysqli_connect(): (28000/1045): Access denied for user 'cwrealey'@'localhost' (using password: NO) in /home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php on line 62
    I checked the query factory php page line 62 and it reads:
    $this->link = mysqli_connect($zf_host, $zf_user, $zf_password);
    $connectionRetry--;
    The script surrounding this entry is:
    Code:
     function connect($zf_host, $zf_user, $zf_password, $zf_database, $zf_pconnect = 'false', $zp_real = false) {
        $this->database = $zf_database;
        $this->user = $zf_user;
        $this->host = $zf_host;
        $this->password = $zf_password;
        $this->pConnect = $zf_pconnect;
        $this->dieOnErrors = $dieOnErrors;
        if (defined('DB_CHARSET')) $dbCharset = DB_CHARSET;
        if (isset($options['dbCharset'])) $dbCharset = $options['dbCharset'];
        if (!function_exists('mysqli_connect')) die ('Call to undefined function: mysqli_connect().  Please install the MySQL Connector for PHP');
        $connectionRetry = 10;
        while (!isset($this->link) || ($this->link == FALSE && $connectionRetry !=0) )
        {
          $this->link = mysqli_connect($zf_host, $zf_user, $zf_password);
          $connectionRetry--;
        }
        if ($this->link) {
          if (mysqli_select_db($this->link, $zf_database)) {
            if (isset($dbCharset) ) {
              mysqli_query($this->link, "SET NAMES '" . $dbCharset . "'");
              if (function_exists('mysqli_set_charset')) {
                mysqli_set_charset($this->link, $dbCharset);
              } else {
                mysqli_query($this->link, "SET CHARACTER SET '" . $dbCharset . "'");
              }
            }
            $this->db_connected = true;
            if (!defined('DISABLE_MYSQL_TZ_SET')) {
              mysqli_query($this->link, "SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'");
            }
            return true;
          } else {
            $this->set_error(mysqli_errno($this->link), mysqli_error($this->link), $dieOnErrors);
            return false;
          }
        } else {
          $this->set_error(mysqli_connect_errno(), mysqli_connect_error(), $dieOnErrors);
          return false;
    I saw a similar thread from 2012 but not solved and this was a while ago. Any suggestions on how to fix it would be appreciated. I download the new version of Zen Cart from the Zen website. My site is www.makupartist.com and to get to zen cart you will need to www.makupartist.com/154
    Thanks
    T

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    That message typically indicates an issue communicatung (authenticating) with the database. Common causes are invalid cedentials, server denial by security rules, or 3rd party code still using direct "mysql_*" function calls.

    Would suggest searching for the phrase "mysql_" in all files (and update or remove the 3rd party code if found). Mixed mysql_ and mysqli_ calls are the most common cause (Zen Cart > 1.5.1 uses mysqli_ internally).

    If intermitten may also be worth asking the hosting provider (can check server logs / enable logging) to further assist tracking down the cause.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Which version of each of the plugins is being run? Were the latest version of those plugins (compatible with ZC 1.5.4) downloaded?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Quote Originally Posted by tbokich View Post
    Access denied for user 'cwrealey'@'localhost' (using password: NO)
    Is "cwrealey" really the username for your MySQL database INSIDE the MySQL settings?
    Why is there no password for that user? (It only says "using password: NO" if you've given it no password in your configure.php files)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2007
    Posts
    67
    Plugin Contributions
    0

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Quote Originally Posted by DrByte View Post
    Is "cwrealey" really the username for your MySQL database INSIDE the MySQL settings?
    Why is there no password for that user? (It only says "using password: NO" if you've given it no password in your configure.php files)
    Hi. No the data base user name is not cwrealey. I did a search of all the php files on the site and cannot find a reference to cwrealey so do not know where it is coming from. I also searched the data base and could not find this entry either

  6. #6
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Might I suggest installing lat9's MyDebug Backtrace: http://www.zen-cart.com/downloads.php?do=file&id=1879

    It should provide a better indication of the origin of the error rather than just starting at the query_factory.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Quote Originally Posted by tbokich View Post
    Hello
    I am currently running a fresh install of 154 with the responsive_avonlee_contempo template. I have Image Handler installed and google site map. I am generating debug logs that read:
    How often is this error occurring? Same time every day? Only when you generate a new sitemap, or is it seemingly random?

    Quote Originally Posted by tbokich View Post
    Code:
    [22-Feb-2015 14:56:46 America/Denver] PHP Warning:  mysqli_connect(): (28000/1045): Access denied for user 'cwrealey'@'localhost' (using password: NO) in /home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php on line 62
    I checked the query factory php page line 62 and it reads:
    This isn't the file where you'll find the error. The error will be caused by whatever module/code is calling this function.

    Although it was mentioned that the problem could be caused by the use of a 'mysql_*' function call, this *isn't* the cause of your problem. The log file provided clearly shows that it is using the correct (for V1.5.4) mysqli_* function call.

    Quote Originally Posted by tbokich View Post
    I have Image Handler installed and google site map.
    The image handler appears to be functioning correctly, so I doubt that that will be the cause.

    The Google Sitemap *is* a *very strong* suspect though, because this module runs somewhat independently of any other store code, and will be one of the few places where the Database credentials used could be different than any other store function.

    Quote Originally Posted by tbokich View Post
    No the data base user name is not cwrealey
    This name is being picked up for *somewhere*, and my guess is that it could be the account name used to access your server?

    It is my suspicion that the Google Sitemap (or some other module) isn't loading the 'application_top' or is missing a 'global $db' variable setting, and because of this there are no $db login credentials to be had, and the server is trying to use a default 'account_username@password' (which is obviously failing).

    If your account name *isn't* "cwrealey" then I feel that you have a really serious issue (such as the site being compromised with a poorly written hacker script), but I'd rather not consider this possibly at this stage, at least not until you can determine which add-on module is calling the mysqli_connect function and/or the source of the 'cwrealey' name.

    Cheers
    RodG

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    ps. I take back my previous 'diagnosis' of the problem.

    I've not been able to find a cause , BUT, after typing "cwrealey@localhost" into Google I'm seeing over 5000 matches from many different sites that don't appear to be ZenCart related.

    If this isn't due to some sort of hack attempt (SQL injection?) it could be a default server setting (I found one reference to this, but seem to have lost it again).

    In other words, I don't think that this a a 'zencart' issue at all.

    I'll let you know if I can find out anything more.

    Cheers
    RodG

  9. #9
    Join Date
    Aug 2007
    Posts
    67
    Plugin Contributions
    0

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Quote Originally Posted by mc12345678 View Post
    Might I suggest installing lat9's MyDebug Backtrace: http://www.zen-cart.com/downloads.php?do=file&id=1879

    It should provide a better indication of the origin of the error rather than just starting at the query_factory.
    Hi, Thanks I installed it and got this:
    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] PHP Warning: mysqli_connect(): (28000/1045): Access denied for user 'cwrealey'@'localhost' (using password: NO) in /home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php on line 62
    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

    [15-Mar-2015 11:42:16 America/Denver] #1 mysqli_connect() called at [/home2/latexinn/public_html/154/includes/classes/db/mysql/query_factory.php:62]
    #2 queryFactory->connect() called at [/home2/latexinn/public_html/154/includes/classes/class.phpbb.php:32]
    #3 phpBB->phpBB() called at [/home2/latexinn/public_html/154/includes/autoload_func.php:79]
    #4 require(/home2/latexinn/public_html/154/includes/autoload_func.php) called at [/home2/latexinn/public_html/154/includes/application_top.php:158]
    #5 require(/home2/latexinn/public_html/154/includes/application_top.php) called at [/home2/latexinn/public_html/154/index.php:26]

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,931
    Plugin Contributions
    96

    Default Re: PHP Warning: mysqli_connect(): (28000/1045)

    Look in your /includes/configure.php file. There's a constant there named DIR_WS_PHPBB.

    Look in the folder that that constant specifies; there's a file named config.php (the phpBB configuration file). The credentials for the phpBB database are parsed out of that file, which apparently has invalid database information.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: 11 Feb 2016, 10:30 PM
  2. Replies: 9
    Last Post: 11 Dec 2015, 11:35 PM
  3. v153 PHP Warning: mysqli_connect(): (28000/1045)
    By vanhorn_s in forum General Questions
    Replies: 29
    Last Post: 17 Sep 2015, 04:40 PM
  4. Replies: 1
    Last Post: 30 Sep 2013, 07:39 PM
  5. Replies: 8
    Last Post: 19 Sep 2012, 03:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg