Open PowerShell-->Run as Administrator
Create a Variable Ex: $w
Get Web Application identity which you are trying to add permissions
Ex: $w=Get-SPWebApplication -identity http://MyWebApplicationName
Now we have to provide access permissions to service account
$w.GrantAccessToProcessIdentity("deomainName\AccountName")
SharePoint 2013 Add Service Accounto to SharePoint Content DB