php – Locking database while running the SQL patches for tables

exception or error:

In application, we are using MySql 5.6, PHP 7 and we are locking whole target database while executing the SQL patches written in PhP script . Patched keeps incrementing like adding new table or modifying existing tables.

During this locking period, no customer can login into application. Lately requirement has changed and we needs to lock the database only “ALTER TABLE” command is present in new SQL patches.

I want to know, In what cases database should be locked while executing SQL patches. For example as of now i can think database should be locked for “ALTER” & “RENAME” SQL commands.

Any suggestion folks?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *