Is it safe to use MySQL triggers in PHP software that will be installed on many random hosting sites

How common are MySQL triggers these days - in the vast majority of hosting companies have the corresponding MySQL server installed?

+4
source share
3 answers

If you did not ask for dedicated hosting or the like, for example, VPS hosting, I would not try to use too much of anything outside the tables.

Most shared / reseller configurations will have permission issues for VIEW, TRIGGERS, and STORED PROCEDURES.

If you do not mind the need for dedicated hosting for your application, I think you can use them.

+5
source

I don’t know about the vast majority, but I would not choose a provider where I was not allowed to run triggers and stored procedures.

Triggers are surprisingly powerful and very difficult to live without doing advanced things, especially things like updates without downtime and moving data between tables.

I would say that triggers are very common in serious settings, but they are almost never present in the early stages of the database.

Only my 50 cents.

+1
source

I think everything will be fine. According to the MySQL documentation, triggers are supported with MySQL 5.0.2:

Trigger support is included with MySQL 5.0.2.

http://dev.mysql.com/doc/refman/5.0/en/triggers.html

This version has been around for a while, starting with version 5.0 in October 2005: http://en.wikipedia.org/wiki/MySQL#Product_history

So, I assume that this will work for you, and if it is not installed on the REALLY OLD host, it should work.

0
source

Source: https://habr.com/ru/post/1383989/


All Articles