Skip to main content
Logo

Create a database connection

This tutorial describes how to setup a site database connection. The database connection is required so that searching and listings can be carried on the website. The tutorial assumes that a database with a user log on account has already been created and there is a folder within the system that has the Database content type assigned to it.

To setup a database connection you will need:

  • The host name of the SQL server (this must resolve from all web servers and the CMS server).
  • The name of the database.
  • The username for the database (which must be a database owner, part of the dbowner role).
  • The password for the database.

Create the SQL database

The process of setting up a SQL database is covered in a separate ZenHub article create a blank database.

Create the database connection

  1. Navigate to the folder where the database connection content type is assigned e.g. Site-Elements/Database
  2. Click on the folder and select New Content from the context menu, the content creation wizard will open.
  3. Enter a title for the new database connection, e.g. [projectname]-preview in the Title box, the titles for the file and menu names will be created automatically.
  4. Click Finish. The Content Confirmation screen confirms the creation of the new Database connection.
  5. Press Edit New Database on the Content Confirmation screen. The Database Connection Editor screen will open.
  6. Enter the SQL Server name, Database Name, Username and Password details.
  7. Press Test Connection, to confirm a connection can be established. A confirmation dialog will be displayed if the connection is successful.
  8. Click Save, then click the Workflow drop down and select Submit and Approve. You have now created the database connection.

Assign the connection to your publishing server

  1. Navigate to the Management Console from the sidebar.
  2. Expand Project Overview.
  3. Select Publishing Servers.
  4. If you have already created a publishing server click the Edit icon next to the server. If you don't have a publishing server, Click Create Publishing Server, the Create new Publishing Server dialog will open.
  5. Select the database connection from the dropdown.
  6. Save the server details.

Setup your search content table

To have dynamic content on your site such as searches and listings you need to have a search content table configured. To do this is straightforward.

  1. Once you have followed the steps above to assign the database connection, re-edit the server and press the Create Search Table button.
  2. Pressing this button will create a table with the name you specified in the Search table name field, by default this is Searchcontent.

In addition to creating a table the system also creates a SQL full-text catalog, this is covered in more detail in how to configure and manage full-text search indexing.