by Geoff Waring.
This solution (removing the NULL characters from uuid column in mdl_events table) worked for me. The upgrade ran successfully after that. I used phpmyadmin to access the tables for editing. The command Eric Oberle provided was a much quicker way than manually editing each row. Many thanks.