I NO LONGER RECOMEND USING THIS WAY. I RECOMEND USING WP-CLI SEARCH-REPALCE. HOW TO USE CAN BE FOUND HERE.

Below is the search and replace for WP which I find really helpful when changing to a new domain. I DO NOT TAKE ANY RESPONSIBILITY FOR USING THIS. MAKE SURE TO BACK UP YOUR DATABASE BEFORE YOU USE THIS SOFTWARE. ALSO THIS MAY NOT BE THE NEWEST VERSION SO IF YOU WANT THE NEWEST VERSION FOR SURE GO TO THE SITE. As always if someone would like me to remove the post just let me know.

https://interconnectit.com/products/search-and-replace-for-wordpress-databases/