This is a quick post on installing Liferay DXP to a SQL Server database.
The Liferay documentation does include the database properties that make up the connection string. But things weren’t as clear when SQL Server is setup for windows integrated authentication, hence this post.
The steps below are presented assuming you are setting up a brand new Liferay installation and pointing it to a SQL Server database using the initial Basic Configuration page that comes up following the first startup of a Liferay server. You could use portal-ext.properties to specify the connection URL provided below.
- Extract the Liferay DXP bundle.
- Add the jdbc driver jar to the classpath.
- Download the Sql Server JDBC Driver and copy the relevant jar to your
tomcat/lib/ext/.
- Download the Sql Server JDBC Driver and copy the relevant jar to your
- Start the server.
- When presented with the Basic Configuration screen, click Change to change the database from the hsql that ships with Liferay.
- Tweak your connection URL. This is important. Note the integratedSecurity=true.
- jdbc:sqlserver://hostname;databaseName=databasename;integratedSecurity=true;
- Clear your username and password. You’re using Windows integrated authentication, so you don’t need the database user.
- That’s not all though. If you attempt to test your configuration by clicking Finish with the above, you will see an error in the logs.
This driver is not configured for integrated authentication.......Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path - sqljdbc_auth.dll is the missing piece. You should be able to find that DLL file in an authsubfolder of your JDBC Driver download. Place that DLL file somewhere on your Windows Path. A typical location may be your
C:\Windows\System32folder. - Restart Liferay to complete the database configuration.
