# Completely re-install MySQL?



## Dare (Feb 23, 2013)

I'm struggling with an issue - I've made an all databases backup using mysqldump -uroot -p --all-databases and after installing new system with mysql I've tried to recover it but it removed the mysql table. Now I've made myself exports of needed tables separately, so I'm ready to import it on fresh instance of mysql5-server.

How I can reinstall mysql5-server completely? When I do make reinstall databases aren't pruned and recreated. Should I remove /var/db/mysql directory manually?


----------



## trh411 (Feb 23, 2013)

Maybe you need to do a "make install" instead?


----------



## Dare (Feb 23, 2013)

I've done 
`# sudo pkg_delete mysql5-server*`
after that 
`# sudo make reinstall`

and databases were preserved. I couldn't make it remove completely existing databases.


----------



## Dare (Feb 24, 2013)

Issue solved by deinstalling and removing /var/db/mysql directory. After installation it's working flawlessly.


----------

