$user = "uuu"; $pass = "uuuuu"; $link = mysql_connect( "uuu", $user, $pass ); if ( ! $link ) die( "Impossible de se connecter à MySQL".mysql_error() ); mysql_select_db( $db ) or die ( "Impossible d'ouvrir : ".mysql_error() ); $query = mysql_query("SELECT table_schema, round(sum(data_length+index_length)/1024/1024,4) AS 'Size' FROM information_schema.tables GROUP BY table_schema ;",$link); $nbTotal = mysql_num_rows($query); print "<hr>".$nbTotal."<hr>"; $i=0; WHILE($nbTotal!=$i) { $table_schema = mysql_result($query,$i,"table_schema"); $Size = mysql_result($query,$i,"Size"); $content .="<tr><td>".$table_schema."</td><td>".$Size."</td></tr>"; $taille = $Size + $taille; $i++; } echo "\".$content.\"---- total, ".$taille." "; ?>
$db = "information_schema"; $user = "aaa"; $pass = "aaaaaa"; $link = mysql_connect( "localhost", $user, $pass ); if ( ! $link ) die( "Impossible de se connecter à MySQL".mysql_error() ); mysql_select_db( $db ) or die ( "Impossible d'ouvrir : ".mysql_error() ); $query = mysql_query("SELECT table_schema, round(sum(data_length+index_length)/1024/1024,4) AS 'Size' FROM information_schema.tables GROUP BY table_schema ;",$link); $nbTotal = mysql_num_rows($query); print "<hr>".$nbTotal."<hr>"; $i=0; WHILE($nbTotal!=$i) { $table_schema = mysql_result($query,$i,"table_schema"); $Size = mysql_result($query,$i,"Size"); $content .="<tr><td>".$table_schema."</td><td>".$Size."</td></tr>"; $i++; } echo "".$content." "; ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question