N/APosted on - 10/21/2011
MySQL Database is under my remote server and a JPS application running under a different server. I need help in writing a trigger for a particular table to be used for audit trail. I can open MySQL server using MySQL Front Utility and can upload JSP codes through FTP to that server.
My question is, how I can write triggers using remote server for MySQL Database?
MySQL: Writing Triggers on remote server
The answer is yes, you can rewrite a table triggering MySql to a remote server by means of the Federated Store Engine. How you suppose to this, here are the basic procedure to acquire one.
Open your table editor to create a Federated Storage Engine;
1. Re Write preferred Table name.
2. Go to Storage Option. Storage Engine must be federated.
3. Go to Connection Type. Note that you have two options here. Choose you preferred connection type based on your requirements. Connection string
Utilize the ellipsis button (on the right side of the figure) to identify the connection parameters using the Build connection string dialog. Fill in the dialogs to specify the following parameters to be included in the connection string:
Remote MySQL Host name
Port to connect through
Remote MySQL Database name
Remote Table name.
3.B Federated Server
It utilizes the Storage Engines, see link for brief handlers for different table types.
This type of server needs Super Privilege when creates. Note that it is only available in MySQL v 5.0.3 beyond. For more workaround you can follow this link.
Hope this answer your queries.