you could do it easily on database-level, mysql supports a string replace function:
select REPLACE(“im,a,test”, “,”, “.”)
-> returns im.a.test
you could use an empty replacement value as well
select REPLACE(“im,a,test”, “,”, “”)
-> returns imatest
using this function in an update-statement could fix your problem. but as always: create a dump first