Web Hosting Talk







View Full Version : MySQL Database Info


jtrovato
10-31-2002, 08:57 AM
I looked quick and didn't see it on the Mysql website.

But if someone knows this quick and can repsoned thank you

I'm making a Info page on a site to see the size of the database in megs.


What is the select query for seeing the size and any other info for a table / database?

John

bhalsted
10-31-2002, 10:23 AM
I've seen this info in the phpMyAdmin project, check out that PHP source. I'm sure it will give some info.

--Ben

UH-Matt
10-31-2002, 12:05 PM
i thought evilwalrus might have had one of these a little while back.. might be worth a check.

sasha
10-31-2002, 12:43 PM
My mysql data folder is /var/lib/mysql. Might be some other place in your case. For every database there is a responding folder in there.

So if you do
du -sh /var/lib/mysql/databasse_name
it will give you the db size in K or M or whatever.

jtrovato
10-31-2002, 04:29 PM
There is a "Select" query to return the size of the database. I'm not sure what it is or how to find out what it is? I have looked around but I didn't find anything.

I was hoping someone knew of the select query

John

jnestor
10-31-2002, 05:46 PM
Not a select query but a MySQL specific function:

show table status

for all the tables or

show table status like 'tablename'

for a specific table.

You'll need a MySQL driver that supports this to access it from a program. The suggestion to look at the PPHMyAdmin code isn't a bad one.