Changing Wordpress DB

So I somewhat successfully migrated my word press blog from one host to another, but I have a weird error were periodically the site can't select database. When I moved mysite over I named the database something new then imported the old database into the new one. After that I changed my wp-config.php file to point to the new database. Is there another step that I need to take?

https://codex.wordpress.org/Moving_WordPress

This article describes moving a WordPress installation. Have you checked your permissions or changed the URL. Have you moved the .htaccess files with you?

A suggestion is to go into the settings and change the permalinks to a different setting, save and then back to update all the permalinks.

Yup that did it thanks!

You mean changing the permalinks?

Yeah,It also turned out that I had forgotten to grant the Wordpress user the ability to rw to the directory. Adding that was the final fix.

Make sure not the whole directory is rw. Because that is an big security hole!

https://codex.wordpress.org/Changing_File_Permissions