Magento: Remove best seller products from admin dashboard

Use the below MySQL queries:


TRUNCATE `sales_bestsellers_aggregated_daily`;
TRUNCATE `sales_bestsellers_aggregated_monthly`;
TRUNCATE `sales_bestsellers_aggregated_yearly`;

Magento: Remove best seller products from admin dashboard

MySQL: Query to get the MySQL database size in MB

SELECT 
table_schema "Database Name", 
SUM(data_length+index_length)/1024/1024 "Database Size in MB", 
SUM(data_free)/1024/1024 "Free Space in MB" 
FROM information_schema.TABLES 
GROUP BY table_schema;
MySQL: Query to get the MySQL database size in MB

The total number of locks exceeds the lock table size

This issue can be resolved by setting the higher values for the MySQL variable “innodb_buffer_pool_size”. The default value for innodb_buffer_pool_size will be 8,388,608.

To change the settings value for “innodb_buffer_pool_size” please see the below set.

1) Locate the file my.cnf from the server. For Linus servers this will be mostly at /etc/my.cnf
2) Add the line “innodb_buffer_pool_size=64MB” to this file
3) Restart the MySQL server

To restart the MySQL server, you can use anyone of the below 2 options:

1) service mysqld restart
2) /etc/init.d/mysqld restart

The total number of locks exceeds the lock table size

Shell: mysqldump with only the table structure and no data

mysqldump -h localhost -u root -p --no-data --compact database_name > database_name.sql

Shell: mysqldump with only the table structure and no data

Backuping a single table using mysqldump

Backuping a single table from a database
mysqldump -u USERNAME -p DATABASE_NAME TABLE_NAME > /path/to/folder/file_name.sql

Backuping a single table using mysqldump

MySql: query result in csv file using command

Form the mysql prompt use the below command:

SELECT * FROM table_name
INTO OUTFILE '/tmp/table_name.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
MySql: query result in csv file using command

command to find the big sizes files on the unix machine using the shell command

find / -type f -size +20000k -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }'
command to find the big sizes files on the unix machine using the shell command