Click Fraud Protection
PHP related blog, freelancer to hire!

Posts Tagged mysql

How to calculate database size in MySQL using sql query?

SELECT count(*) TABLES, concat(round(sum(table_rows)/1000000,2),’M’) rows, concat(round(sum(data_length)/(1024*1024*1024),2),’G’) DATA, concat(round(sum(index_length)/(1024*1024*1024),2),’G’) idx, concat(round(sum(data_length+index_length)/(1024*1024*1024),2),’G’) total_size, round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES WHERE  TABLE_SCHEMA = ‘YOUR DATABASE NAME’;

Read more

How to return all magento product SKUs in one SQL?

Sometimes when you create some cart rules in magento you want to use condition that product SKU “is not one of” you can insert comma separated list of SKUs there to give you just idea look below   connect to your database from CLI or use phpMyAdmin […]

Read more

Mysql client for Ubuntu

I’ve tried TORA, which seems to be nice sudo apt-get install tora sudo apt-get install libqt3-mt-mysql Any others?

Read more

How to modify Drupal Views SQL

I wanted to sort my views result on field which doesn’t exists in db table, so my idea was to use: SELECT … WHERE field IN (value1, value2) … ORDER BY field = value1 DESC, field = value2 DESC  etc Which orders my elements exactly as I […]

Read more