Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16714

Cannot get database size for MySQL database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.3.3
    • ACP
    • PHP 7.2.34, MySQL 5.6.51

      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);

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

              Created:
              Updated:
              Resolved: