Databases

Cannot attach database SQL Server 2012 error 5

When upgrading from MS SQL Server 2008 to MS SQL Server 2012, I decided to retain the data directories I was using in SQL 2008. I therefore did a backup and detached all my private databases, removed SQL 2008 and did a clean install of MS SQL 2012. I logged into the new server and on trying to attach back any of my databases, I encountered the following error: CREATE FILE encountered operating system error 5 (Access is denied) while attempting to open or create the physical file .