Install and Connect

  1. Download the DataJoint MATLAB Toolbox from the MATLAB Central FileExchange.

  2. Open DataJoint.mltbx and follow installation instructions.

  3. After installation, verify from MATLAB that you have the latest version of DataJoint (3.0.0 or above):

    >> dj.version
    DataJoint version 3.0.0
    
  4. At the MATLAB command prompt, assign the environment variables with the database credentials. For example, if you are connection to the server alicelab.datajoint.io with username alice and password haha not my real password, execute the following commands:

    setenv DJ_USER alice
    setenv DJ_HOST alicelab.datajoint.io
    setenv DJ_PASS 'haha not my real password'
    

You will need to execute these commands at the beginning of each DataJoint work session. To automate this process, you might like to use the startup.m script.

However, be careful not to share this file or commit it to a public directory (a common mistake), as it contains a your login credentials in plain text. If you are not sure, it is better not to set DJ_PASS, in which case DataJoint will prompt to enter the password when connecting to the database.

To change the database password, use the following command

>> dj.setPassword('my#cool!new*psswrd')

And update your credentials in your startup script for the next session.

Other Configuration Settings

If you are not using DataJoint on your own, or are setting up a DataJoint system for other users, some additional configuraiton options may be required to support TLS or external storage .

TLS Configuration

Starting with v0.12 (Python) and v3.3.1 (MATLAB), DataJoint will by default use TLS if it is available. TLS can be forced on or off with the boolean use_tls in MATLAB, or dj.config['database.use_tls'] in Python.

Talk to the Community