Hello out there,
I want to know the size of the mysql database, where e.g. name=peter. I want the size of hole the rows (all columns in the rows). The data is images, number and text saved as blob, int and varchar.
Thank you, Ulrik, Denmark
If you want to know the number of rows where name=peter this is your query:
SELECT COUNT(*) AS count From table WHERE name='peter'
no no no, I want the size in MB of the rows!
If you use phpMyAdmin, when select a table. In the buttom you will see the size of data and of the index! But the php-code in phpMyAdmin is too crasy, I don't understand, how they find the size!!! HELP
Thank you, UlriK Q K
The easiest way that I know of is to just look at the file sizes in whatever directory your db is stored in.
The file <tablename>.MYD contains the data for your table, and the file <tablename>.MYI contains the indexes for your table.
It don't works... It is not my own server, so I cannot get the files!
[BUMP] Because I need help in this too!
Its a simple Query:
$query = "SHOW TABLE STATUS FROM $db_name LIKE '$table_name'"; while($status_row = mysql_fetch_array($result)) { $table_size = $status_row[Data_length]; $table_size = $status_row[Index_length]; }
This gets as many rows as there are tables in the specified database with names LIKE '$table_name'.
To make this more efficient you should avoid storing the images in the database, and instead store the path to the image, the image size (in bytes), the image dimensions and any other info you wish to store.