Running the MobiLink server

All MobiLink clients synchronize through the MobiLink server. None connect directly to a database server. You must start the MobiLink server before a MobiLink client synchronizes.

For a list of mlsrv11 command line options, see MobiLink server options.

The MobiLink server opens connections, via ODBC, with your consolidated database server. It then accepts connections from remote applications and controls the synchronization process.

To start the MobiLink server

For information about connection parameters, see -c option.

You must specify connection parameters. Other options are available, but are optional. These options allow you to specify how the server works. For example, you can specify a cache size and logging options.

For more information about mlsrv11 options, see mlsrv11 syntax.

Note

The mlsrv11 options allow you to specify how the MobiLink server works. To control what the server does, you define scripts that are invoked at synchronization events. See Synchronization events.

Example

The following command starts the MobiLink server using the ODBC data source SQL Anywhere 11 CustDB to identify the consolidated database. Enter the entire command on one line.

mlsrv11
  -c "dsn=SQL Anywhere 11 CustDB;uid=DBA;pwd=sql"
  -zs MyServer
  -o mlsrv.log
  -vcr
  -x tcpip(port=3303)
  -xo tcpip

In this example, the -c option provides a connection string that contains an ODBC data source name (DSN) and authentication. The -zs option provides a server name. The -o option specifies that the log file should be named mlsrv.log. The contents of mlsrv.log are verbose because of the -vcr option. The -x option opens a port for version 10 and 11 clients, and the -xo option opens a port for version 8 and 9 clients. You must specify a port with either the -x option or the -xo option, otherwise the command fails because the default port is used for both options.

You can also start the MobiLink server as a Windows service or Unix daemon. See Running the MobiLink server outside the current session.

Required permissions

You must specify a database user for the MobiLink server to connect to the database server. You specify the database user with the mlsrv11 -c option or in the DSN.

This database user must have full select, insert, update, and delete permissions on the MobiLink system tables, and must also have execute permissions on the MobiLink system procedures. By default, the database user who runs the MobiLink setup script has these permissions. If you want to use another database user to run the MobiLink server, you must grant permissions for that user on the ml_* tables and the ml_add_*_script system procedures.

For example, in a SQL Anywhere consolidated database you can grant the required permissions as follows:

CREATE USER DBUser IDENTIFIED BY SQL;
GRANT ALL ON dbo.ml_user to DBUser;
...
GRANT EXECUTE ON dbo.ml_add_table_script TO DBUser;
...

You must grant permission for each MobiLink system table and system procedure. For a list of all MobiLink system tables and system procedures, see MobiLink server system tables and MobiLink server system procedures.

The database user also needs the appropriate permission on all tables referenced in the MobiLink scripts, ands execute permissions on any procedures referenced in the MobiLink scripts.

For more information about setting permissions, see GRANT statement.

For more information about setup scripts, see Setting up a consolidated database.