Thursday, October 27, 2011

MySQL: Enable Federated Engine in MySQL 5.0 Windows

Step 1:

go to C:\Program Files\MySQL\MySQL Server 5.0

Step 2:
open the file my.ini

just put federated after [mysqld] and save the file.

Step 3:

restart MySQL server and type command SHOW ENGINES .

Step 4:

You will see a value  'YES' in Support column for engine FEDERATED.


Wednesday, October 26, 2011

MySQL : Preventing deletion of specific rows - Easy Method

Step 1: Create a backup table for the original table

Step 2: Create before delete trigger on both tables to secure the valid records at the time of deletion.


Step 3: Create a view with union on  both the tables.

Step 4: User can access the data using the view at any point of time.

Step 5: Delete operation will be executed on both the tables ( Original and Backup Table ).