Main Content

Setup Requirements for Database Connection

Refer to these setup requirements to establish the first connection to a database.

  • If you do not have an installed database and want to store relational data quickly, use the MATLAB® interface to SQLite. For details, see Interact with Data in SQLite Database Using MATLAB Interface to SQLite.

  • Ensure that you know the name of your database server or machine, the name of your database, the port number, and your user name and password. For ODBC drivers, once you create a data source, remember the data source name. For JDBC drivers, ensure that you know the file path where the JDBC driver is installed. For some JDBC drivers, you also need the URL string and the driver Java® class object. For some databases, more credentials are required. Contact your database administrator for all required database credentials to establish a connection to the database.

  • Ensure that you have access to your database and driver documentation.

  • Determine if your database uses operating system authentication. If you can connect to your database from outside of MATLAB without providing a user name and password, then your database uses operating system authentication. Exceptions to this rule are databases set up without any operating system or database authentication requirements, such as Microsoft Access® and SQLite database files. Connecting to a database using operating system authentication from MATLAB can require additional steps.

  • Ensure that you have write access to the path MATLAB displays after you execute prefdir at the command line.

  • For ODBC data sources, ensure that you have administrator rights to the database for creating and modifying data sources.

See Also

Related Topics