You need to copy the database to isolated storage on first run, as the installation folder is read-only. You will also need to change the connection string:
data source=isostore://mydb.sdf
See much more in my blog post here: http://erikej.blogspot.dk/2013/04/generate-windows-phone-8-local-database.html