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
- Navigate to the folder where the database connection content type is assigned e.g. Site-Elements/Database
- Click on the folder and select New Content from the context menu, the content creation wizard will open.
- 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.
- Click Finish. The Content Confirmation screen confirms the creation of the new Database connection.
- Press Edit New Database on the Content Confirmation screen. The Database Connection Editor screen will open.
- Enter the SQL Server name, Database Name, Username and Password details.
- Press Test Connection, to confirm a connection can be established. A confirmation dialog will be displayed if the connection is successful.
- 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
- Navigate to the Management Console from the sidebar.
- Expand Project Overview.
- Select Publishing Servers.
- 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.
- Select the database connection from the dropdown.
- 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.
- Once you have followed the steps above to assign the database connection, re-edit the server and press the Create Search Table button.
- 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.
Was this article helpful?