If you get the following error when running the SharePoint 2010 configuration wizard :
Cannot connect to database master at SQL Server at <SQL Server name>. The database might not exist, or the current user does not have permission to connect to it.
This is a combination of two issues which I faced
1 – Firewall issues
2 – Insufficient SQL permissions on the user running the Configuration wizard
Allowing the SQL machine to be accessed through the Firewall :
Section 2 – Ensuring that the user running the configuration wizard has sufficient permissions
As well as making sure that the user who will be specified for the Database access account has sufficient privileges, you will need to also ensure that the user running the configuration wizard has at least db_secutirytadm in and db _creater permissions accessible(in the below image I have specified db_owner to give full access as a testing method )
References:
http://blogs.technet.com/b/tothesharepoint/archive/2011/01/12/troubleshooting-sharepoint-configuration-error-cannot-connect-to-database-master-at-server-name.aspx