Skip to content

Configure Mideye Server 4 Database Connection

Mideye Server requires a database to store user accounts, authentication logs, and configuration data. This guide explains how to configure the database connection for both Microsoft SQL Server and MySQL.

Use this guide to:

  • Configure a new database connection after installation
  • Switch between SQL Server and MySQL
  • Install the MySQL JDBC connector on Windows
  • Enable TCP/IP for SQL Server Express
  • Troubleshoot database connection issues

For hardware and software requirements, see Pre-install checklist.


After a new installation of the Mideye Server, a popup window with the text “Database Connection not properly set up” will be shown when opening Mideye Configuration Tool.

Installing or upgrading a Mideye Server requires a database account with rights to ALTER, CREATE and DELETE tables in the Mideye database.

Configure the following to complete the database connection:

  • Database Type: Select SQL Server or MySQL.

  • Database address: Enter the database hostname or IP.

  • TCP-port: The default TCP port for SQL Server is 1433. For MySQL it is 3306. This can be modified if needed.

  • Connection idle time: Default value is 10 minutes. This parameter is rarely changed.

  • User: Enter the username of the database user. This user must have alter, create and delete permissions.

  • Password: Enter the password of the database user.

  • Database name: Enter the database name. Be advised that Mideye requires a pre-configured empty database. Refer to Microsoft or CentOS documentation on how to create an empty database.

  • Domain (optional): Enter domain name if the database is part of a domain.

  • Instance(optional): If instances are used, enter the instance name. Be advised that Mideye Server will automatically use port udp/1434 when searching for databases inside an instance.

Mideye Configuration Tool database connection dialog with SQL Server configuration fields

On Windows, the MySQL JDBC driver must be installed manually before connecting to MySQL:

  1. Close Mideye Configuration Tool if open
  2. Download mysql-connector-java-5.1.49.jar from the MySQL Connector/J Archives
  3. Copy the JAR file to all three locations:
    • C:\Program Files (x86)\Mideye Server\lib\
    • C:\Program Files (x86)\Mideye Server\webserver\lib\
    • C:\Program Files (x86)\Mideye Server\webserver\webapps\ROOT\WEB-INF\lib\
  4. Open Mideye Configuration Tool — MySQL should now be available as a database type

Microsoft SQL Server Express TCP/IP Configuration

Section titled “Microsoft SQL Server Express TCP/IP Configuration”

Why Can’t I Connect to SQL Server Express on Port 1433?

Section titled “Why Can’t I Connect to SQL Server Express on Port 1433?”

SQL Server Express is designed for local development and ships with remote TCP/IP connections disabled. This causes the following errors when Mideye Server tries to connect:

  • “Cannot connect to database”
  • “Connection refused on port 1433”
  • “TCP/IP connection to host failed”
  • “A network-related or instance-specific error occurred”
  • “No connection could be made because the target machine actively refused it”

To fix this, you must:

  1. Enable the TCP/IP protocol in SQL Server
  2. Configure port 1433 (or your chosen port)
  3. Open Windows Firewall for port 1433
  4. Restart the SQL Server service
  1. Open SQL Server Configuration Manager

    • On Windows Server 2016/2019/2022: Search for “SQL Server Configuration Manager” in the Start menu
    • On older systems: Find it under StartMicrosoft SQL ServerConfiguration Tools
  2. In the left pane, expand SQL Server Network Configuration

  3. Click Protocols for SQLEXPRESS (or your instance name)

  4. In the right pane, right-click TCP/IP and select Enable

SQL Server Configuration Manager showing TCP/IP protocol being enabled for SQLEXPRESS instance

  1. Right-click TCP/IP again and select Properties

  2. Go to the IP Addresses tab

  3. Scroll down to the IPAll section at the bottom

  4. Clear the TCP Dynamic Ports field (leave it empty)

  5. Set TCP Port to 1433

SQL Server Configuration Manager TCP/IP Properties showing IPAll section with port 1433 configured

SQL Server port 1433 must be allowed through Windows Firewall:

  1. Open Windows Defender Firewall with Advanced Security
  2. Click Inbound RulesNew Rule
  3. Select Port and click Next
  4. Select TCP and enter 1433 in “Specific local ports”
  5. Select Allow the connection
  6. Check all profiles (Domain, Private, Public) as appropriate
  7. Name the rule SQL Server TCP 1433 and click Finish

Or use PowerShell (run as Administrator):

Terminal window
New-NetFirewallRule -DisplayName "SQL Server TCP 1433" -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow

The changes only take effect after restarting SQL Server:

  1. In SQL Server Configuration Manager, click SQL Server Services in the left pane
  2. Right-click SQL Server (SQLEXPRESS) and select Restart

Or use PowerShell:

Terminal window
Restart-Service -Name 'MSSQL$SQLEXPRESS'

Test that port 1433 is now accessible:

From the Mideye Server, open Command Prompt and run:

Terminal window
telnet localhost 1433

If the screen goes blank (no error), TCP/IP is working. Press Ctrl+] then type quit to exit.

Or use PowerShell:

Terminal window
Test-NetConnection -ComputerName localhost -Port 1433

You should see TcpTestSucceeded : True.


”Cannot connect to port 1433” — Checklist

Section titled “”Cannot connect to port 1433” — Checklist”

If you still cannot connect after following the steps above, verify each item:

CheckHow to VerifyFix
TCP/IP enabledSQL Server Configuration Manager → ProtocolsEnable TCP/IP protocol
Static port setTCP/IP Properties → IPAll → TCP Port = 1433Set port, clear dynamic ports
SQL Server runningServices.msc → SQL Server (SQLEXPRESS)Start the service
Firewall openTest-NetConnection localhost -Port 1433Add firewall rule for 1433
SQL Browser runningOnly needed for named instances with dynamic portsStart SQL Server Browser service
Correct instanceCheck if using default or named instanceUse correct connection string

SQL Server Authentication vs Windows Authentication

Section titled “SQL Server Authentication vs Windows Authentication”

Mideye Server supports both authentication modes:

ModeConnection StringWhen to Use
SQL Server AuthenticationUsername + PasswordMideye on separate server
Windows AuthenticationDomain\UsernameMideye on same server as SQL

If using a named instance (e.g., YOURSERVER\SQLEXPRESS):

  • UDP port 1434 must be open for SQL Server Browser
  • The SQL Server Browser service must be running
  • Or specify the port directly: YOURSERVER,1433 (note the comma, not colon)

Run this diagnostic query in SQL Server Management Studio to check what ports SQL Server is listening on:

SELECT DISTINCT local_net_address, local_tcp_port
FROM sys.dm_exec_connections
WHERE local_net_address IS NOT NULL;

If Mideye Configuration Tool hangs or fails to start due to database connection issues:

  1. Close Mideye Configuration Tool
  2. Navigate to the config directory:
    • Windows: C:\Program Files (x86)\Mideye Server\config\
    • Linux: /opt/mideyeserver/config/
  3. Backup DbConnection.properties (copy to a safe location)
  4. Delete DbConnection.properties
  5. Restart Mideye Configuration Tool
  6. Re-enter the correct database connection settings
SymptomLikely CauseSolution
Connection timeoutFirewall blocking portOpen TCP 1433 (SQL) or 3306 (MySQL)
Authentication failedWrong credentialsVerify username/password in database server
Database not foundWrong database nameCheck database exists and name is spelled correctly
TCP/IP connection refusedSQL Express TCP disabledSee SQL Server Express TCP/IP Configuration
”Target machine actively refused”SQL Server not listening on TCPEnable TCP/IP and set port 1433
Named instance not foundSQL Browser not runningStart SQL Server Browser or use static port

Why does SQL Server Express not accept TCP connections by default?

Section titled “Why does SQL Server Express not accept TCP connections by default?”

Microsoft disables TCP/IP in SQL Server Express as a security measure. Express edition is intended for local development, so remote connections are opt-in.

Yes. Configure any available port in SQL Server Configuration Manager and use the same port in Mideye’s database settings. Remember to update firewall rules accordingly.

Only if you use dynamic ports or need to connect to a named instance without specifying the port. For static port 1433 with the default instance, SQL Server Browser is not required.

How do I check if SQL Server is listening on port 1433?

Section titled “How do I check if SQL Server is listening on port 1433?”

Run netstat -an | findstr 1433 in Command Prompt. You should see LISTENING for port 1433.