Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16714

Cannot get database size for MySQL database

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.3.3
    • Fix Version/s: None
    • Component/s: ACP
    • Labels:
    • Environment:
      PHP 7.2.34, MySQL 5.6.51

      Description

      See attached error message. This happened after an upgrade from phpBB 3.2.8 to 3.3.3, initially when reporting statistics but any time going to the ACP General Tab. This function starting on line 2836 in /includes/functions_admin.php failed for the mysqli case:

      case 'mysqli':
      $mysql_engine = ['MyISAM', 'InnoDB', 'Aria'];
      $db_name = $db->get_db_name();
      $database_size = 0;

      $sql = 'SHOW TABLE STATUS
      FROM ' . $db_name;
      $result = $db->sql_query($sql, 7200);

      while ($row = $db->sql_fetchrow($result))
      {
      if (isset($row['Engine']) && in_array($row['Engine'], $mysql_engine))

      { $database_size += $row['Data_length'] + $row['Index_length']; }

      }

      $db->sql_freeresult($result);

      $database_size = $database_size ? $database_size : false;

      break;

      It's probably the database name that threw it off: Bootle-History. Maybe the dash? 

      Here is the config.php (password x'ed out):

      <?php
      // phpBB 3.0.x auto-generated configuration file
      // Do not change anything in this file!
      $dbms = 'mysqli';
      $dbhost = 'localhost';
      $dbport = '';
      $dbname = 'Bootle-History';
      $dbuser = 'Bootle-History';
      $dbpasswd = 'xxxxxxxx';
      $table_prefix = 'phpbb_';
      $acm_type = 'file';
      $load_extensions = '';

      @define('PHPBB_INSTALLED', true);
      // @define('DEBUG', true);
      // @define('DEBUG_EXTRA', true);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              MarkDHamill MarkDHamill
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: