How to upgrade a MySQL database using numbered scripts based on a version field
Create "main script" which detects current DB version and shells only scripts proper for it. For example, it can look like

drop procedure if exists main_proc;
delimiter @@;
create procedure main_proc
    select version into @version from service_table;
    if @version &lt; 2 then 
        source 001.sql;
        update service_table set version = 2;
    end if;
    if @version &lt; 2.5 then 
        source 02.sql;
        update service_table set version = 2.5;
    end if;
    if @version &lt; 3 then 
        source 3.sql;
        update service_table set version = 3;
    end if;
    -- and so on
    end; 
@@;
delimiter ;
call main_proc;
drop procedure main_proc;


Don't forget error handlers (no script file or access error, error during script execution, etc.).