This article describes how to connect an M&M Central to Microsoft SQL Server instance.
Setting up the Database
Men & Mice requires that a blank database is created on the database server, with the collation SQL_Latin1_General_CP1_CS_AS, and a login (Windows or SQL server authenticated) that has db_owner access to that database and an effective default schema of mmCentral.
The attached CreateDatabase.sql is a suggestion for the database and database server setup. Please note that this script also configures the SQL server itself, which is unnecessary and undesirable in most cases. Therefore, review the script with your database administrator and only run appropriate parts of it.
Before you run the script please go through the script and change the necessary entries accordingly. This includes path strings (default C:/Data) and very important also the password, which is set by default to "1234" in the script!
Subsequently the script will create:
- a user "mmSuiteDBUser" with the password that you have inserted in the script.
- an empty database with the name "mmsuite" and the following collation:
For details please have a look into the CreateDatabase.sql script.
Configuring the connection parameters
If it's a dedicated server please don't forget to enable the TCP/IP protocol with the SQL Configuration Manager
Men&Mice Central running on Windows
- Download the Men&Mice mmdbprefs.exe tool
- Copy the mmdbprefs.exe into the data directory of the Men&Mice Central.
Usually located in one of these locations:
- C:\Program Files\Men and Mice\Central\Data
- C:\Program Files(x86)\Men and Mice\Central\Data
- C:\ProgramData\Men and Mice\Central (Windows Server 2008 R2 and later)
- Then start the mmdbprefs.exe tool by double-click. It will ask you a few questions
For MS SQL Server please enter "2" and confirm with Enter.
Please type in the database server in the following format:
Confirm your input by pressing the Enter key.
Type in the username, default in the script is "mmSuiteDBUser", that will be used to connect to your database instance on the specified SQL server. Then press Enter. If you let the database user name empty Windows Authentication will be used instead of a user based connection (this requires to run the M&M Central service under credentials that have access by Windows Authentication to the database).
Finally you need to provide the password (it will not be displayed in the shell) and then press Enter.
Now the preferences.cfg file in the data directory contains beside the fingerprint of Central (i.e. the "password" XML-tag) four additional XML tags: database, databaseserver, databaseusername and databasepassword
The preferences.cfg file for normal user/password authentication should look like:
An example preferences.cfg file for the Windows Authentication method should look like (databaseusername tag must be present and the value attribute must be set to empty string):
Men&Mice Central running on Linux
- Navigate to the data directory of the Men&Mice Central:
Usually located in:
Edit the preferences.cfg file with in that directory with the following:
Save your changes.
Establishing a connection to Men&Mice Central
Since the database was freshly created you can now follow the normal installation procedure. Please see the installation guide and the user manual of the M&M Suite for further information.
SQL Server in High Availability
Mirrored SQL Server instances
Men&Mice Central (v220.127.116.11 and above) can be made aware of mirrored instances of the database. In the case a failover occurs the Men&Mice Central will try to talk to the new principal server, i.e. the failover partner, if specified.
Change the DatabaseServer value in the preferences.cfg or rerun mmdbprefs.exe and provide the value:"serverA@mmsuite;Failover_Partner=serverB", where "serverA" and "serverB" are the principal and mirror SQL servers, and "mmsuite" is the name of the database
- If the machine running M&M Central does not have SQL Server installed, install the Microsoft SQL Server Native Client tools.
Always On Availability Groups
Men&Mice Central supports the use of Always On Availability Groups (v9.3.0 and above), In the case of a failover occurs the Men&Mice Central will refresh its database connections to the new primary replica.
Change the DatabaseServer value in the preferences.cfg to the virtual IP address or the FQDN of the availability group listener: