Blog Archives

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`;

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;

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

Shell: mysqldump with only the table structure and no data

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

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

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';

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 }'

change openx database connection

  • Open the “var” folder
  • Open the file with name “your-hostname“.conf.php
  • Edit the variables under the line “[database]“

Apache: disable directory listing

Open the file httpd.conf

Change the below lines

Options Indexes FollowSymLinks

to

Options -Indexes

MSSQL: logs/httpd.pid overwritten — Unclean shutdown of previous Apache run

1. Stop all WAMP services and the SQL Server (Express) service

2. Get ntwdblib.dll version 2000.80.194.0 (http://webzila.com/dll/1/ntwdblib.zip OR get a free copy of ntwdblib.dll by downloading MS SQL Server 2000 SP4 from Microsoft Website. It contains a copy of ntwdblib.dll version 2000.80.194.0 in the system directory). Copy and replace any other versions of this file to the following locations:

  • Your PHP binaries folder (ie C:\wamp\bin\php\php5.2.6)
  • Your Apache binaries folder (ie C:\wamp\bin\apache\apache2.2.8\bin)
  • Windows\System32\

3. Configure SQL Server to accept TCP connections and Named Pipes through the SQL server configuration manager (yes you will need the client tools installed).

4. Configure SQL Server for Mixed mode authentication and remember the password you set for sa

5. Start the SQL Server Service

6. Edit your php.ini and set the

mssql.secure_connection = On

7. Make sure your wamp folder has proper access rights (full control for ‘everyone’).

8. Start all services from the WAMP menu.

Follow

Get every new post delivered to your Inbox.

Join 266 other followers

%d bloggers like this: