Thanks gavo for the information. I cannot get into var/lib but i found another way of doing it. I created a new empty database and then copied all the tables from the old database into the new one and this sorted the problem.

All fixed.