Configure Driver and Data Source - MATLAB & Simulink (original) (raw)

Database Toolbox™ enables you to create a connection to a database installed on a machine or located in the cloud. You can connect to relational databases using ODBC and JDBC drivers, or you can connect to some databases using native interfaces. This topic provides information about configuring a driver and creating a data source for connecting to a relational database using a driver. For details about connecting to a database using a native interface, see Connection Options.

To connect to an installed database, first install the driver. For all databases, define a data source for an ODBC or JDBC driver. If you do not have an installed database and want to store relational data quickly, you can use the MATLAB® interface to SQLite. For details, see Interact with Data in SQLite Database Using MATLAB Interface to SQLite.

ODBC uses a Data Source Name (DSN) that is the logical name to refer to the driver and other required information for accessing data. This name is used to connect to an ODBC data source, such as a Microsoft® SQL Server® database.

Configure Driver and Create Data Source

Find your database environment in the following table by choosing your platform across the top and your database on the left. The link brings you to a page that has all the required steps for connecting to your database.

Database Platform
Windows® macOS 64-bit Linux® 64-bit
Microsoft Access® Microsoft Access ODBC for Windows Not supported Not supported
Microsoft SQL Server Microsoft SQL Server ODBC for WindowsMicrosoft SQL Server ODBC for Windows DSN-Less ConnectionMicrosoft SQL Server JDBC for Windows Microsoft SQL Server JDBC for macOSMicrosoft SQL Server ODBC for macOSMicrosoft SQL Server ODBC for macOS DSN-Less Connection Microsoft SQL Server ODBC for LinuxMicrosoft SQL Server ODBC for Linux DSN-Less ConnectionMicrosoft SQL Server JDBC for Linux
Oracle® Oracle ODBC for WindowsOracle JDBC for Windows Oracle JDBC for macOS Oracle JDBC for Linux
MySQL® MySQL ODBC for WindowsMySQL ODBC for Windows DSN-Less ConnectionMySQL JDBC for Windows MySQL JDBC for macOSMySQL ODBC for macOSMySQL ODBC for macOS DSN-Less Connection MySQL ODBC for LinuxMySQL ODBC for Linux DSN-Less ConnectionMySQL JDBC for Linux
PostgreSQL PostgreSQL ODBC for WindowsPostgreSQL ODBC for Windows DSN-Less ConnectionPostgreSQL JDBC for Windows PostgreSQL JDBC for macOSPostgreSQL ODBC for macOSPostgreSQL ODBC for macOS DSN-Less Connection PostgreSQL ODBC for LinuxPostgreSQL ODBC for Linux DSN-Less ConnectionPostgreSQL JDBC for Linux
SQLite SQLite JDBC for Windows SQLite JDBC for macOS SQLite JDBC for Linux

For ODBC-compliant or JDBC-compliant databases that are not listed in the table, see Other ODBC-Compliant or JDBC-Compliant Databases.

Limitations

The ODBC database connection on the Linux and macOS platform does not support the following:

See Also

database | close