Exception PDOException with message SQLSTATE[HY000] Name too long for LOGINREC field (severity 2)

Error: When connecting to MS SQL using freetds 0.91 and php>5.3:

Exception ‘PDOException’ with message ‘SQLSTATE[HY000] Name too long for LOGINREC field (severity 2)’

Cause:

Any string exceeds 30 characters in connection info like username, password, client host name will cause this error.

Solution:

Check client hostname in /etc/sysconfig/network, reduce it to less than 30 characters

Check username and password length in DB connection string, reduce it to less than 30 characters

Exception PDOException with message SQLSTATE[HY000] Name too long for LOGINREC field (severity 2)

Error installing SQL Server Database Engine Services Instance Features: Wait on the Database Engine recovery handle failed

Error when install MS MSQL:
Error installing SQL Server Database Engine Services Instance Features
Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.

Solution:
When you come to Server Configuration Screen, Change the Account Name of Database Engine Service to NT AUTHORITY\NETWORK SERVICE and continue installation and it will successfully install all components without any error.

Error installing SQL Server Database Engine Services Instance Features: Wait on the Database Engine recovery handle failed