Posts Tagged ‘sql’

Get MySQL Table Size

Tuesday, March 30th, 2010

MySQL table size

MySQL Table Size

What to do if you need to know some MySQL database table real size? Thanks to MySQL, it is not very complex task. There is no need to know the table row length and multiply it on quant of rows in that table. Just remember about MySQL system database called information_schema. It has right information for those who want to get DB table real size. Let’s look into the information_schema.tables table. We will use next fields from it:
TABLE_SCHEME (database name),
TABLE_NAME (it is self-explaining),
TABLE_ROWS (quant of rows in the table),
DATA_LENGTH (table data length in bytes),
INDEX_LENGTH (table indexes length in bytes)

Read the rest of this entry

PHP code to execute MySQL script

Thursday, September 10th, 2009



There are advanced and comfortable tools to manage your MySQL databases. For example:

But sometimes you can not use those tools and need the ability to execute some SQL script on server by your own hands, easy and fast way. What to do in such situation? Use this PHP code to execute all SQL commands from SQL script text file, one by one:

Read the rest of this entry