Main Content

Database Connection Error Messages

This table describes how to address common errors you might encounter while connecting to the Database Toolbox™ using Database Explorer or the command line.

Connection Error Messages and Probable Causes

VendorError MessageProbable CausesResolution

All

Undefined variable 'database' or class 'database.ODBCConnection'.

  • Database Toolbox software is not installed.

  • You are connecting using the native ODBC interface with MATLAB® R2013a or earlier.

  • Ensure that Database Toolbox software is installed.

  • If you want to use the native ODBC interface, ensure that MATLAB R2013b or later is installed.

Unable to access data source name. Use databaseConnectionOptions to create a JDBC data source. Use configureODBCDataSource to create an ODBC data source.

The specified data source name does not exist.

This error message occurs with Windows® only.

Create a JDBC or ODBC data source using the corresponding databaseConnectionOptions or configureODBCDataSource function. For examples, see Configure Driver and Data Source.

Parameter name must be 'AutoCommit', 'ReadOnly', 'LoginTimeout', 'ErrorHandling'.

The specified name-value arguments are invalid with the database(datasource,username,password,Name,Value) syntax.

Specify one or more of these valid name-value arguments with the database function: 'AutoCommit', 'ReadOnly', 'LoginTimeout', and ErrorHandling.

All ODBC-Compliant Databases

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Data source name is not spelled correctly.

Verify your data source name.

[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between Driver and Application

There is a difference in the bitness (32-bit or 64-bit) between the database, driver, and MATLAB.

Use a 64-bit driver. If you have issues working with the ODBC driver, use the JDBC driver instead. For details about driver installation, see Configure Driver and Data Source.

To address differences in bitness for Microsoft Access®, see Microsoft Access ODBC for Windows.

ODBC Driver Error: [unixODBC][Driver Manager]Can't open lib‘/driver.dylib' : file not found
  • Driver does not exist.

  • Improper driver manager is used.

  • Make sure that the libraryexists.

  • Make sure that unixODBC is installed with Homebrew

  • Make sure that iODBC is installed.

  • Try adding the DriverManager name-value argument with the database function.

ODBC Driver Error: [unixODBC][Driver Manager]Data source name not found and no default driver specified
  • Driver entry is not installed properly.

  • Data source is not installed properly.

  • Make sure that the driver entry is installed at /usr/local/etc/odbcinst.ini

  • Make sure that the data source entry is installed at ~/.odbc.ini

ODBC Driver Error: [iODBC][Driver Manager]dlopen(MariaDB ODBC Driver, 0x0006): tried: 'MariaDB ODBC Driver' (no such file)

iODBC cannot find the driver.

Make sure that the driver entry is installed at /Library/ODBC/odbcinst.ini.

Error using odbc Unable to access data source name

Data source name is not spelled correctly.

Make sure that the data source entry is installed at ~/.odbc.ini.

All JDBC-Compliant Databases

Unable to find JDBC driver file on MATLAB Java class path.You specify a path to the JDBC driver JAR file that is not on the static or dynamic class path. Or, you specify an incorrect driver name in the Driver box of the JDBC Data Source Configuration dialog box.

Specify the full path to the JDBC driver file in the Driver Location box and the correct driver name in the Driver box of the JDBC Data Source Configuration dialog box. For details, see the databaseConnectionOptions function.

Unable to access data source name. Use databaseConnectionOptions to create a JDBC data source.

The specified data source name does not exist.

This error message occurs with UNIX® only.

Create a JDBC data source using the databaseConnectionOptions function. For examples, see Configure Driver and Data Source.

JDBC data source does not contain driver location. Use databaseConnectionOptions to specify JDBC driver location.

The specified driver location in the JDBC data source is invalid.

Modify the JDBC data source to specify a valid JDBC driver location using the databaseConnectionOptions function.

Microsoft Access

[Microsoft][ODBC Microsoft Access Driver] ‘(unknown)’ is not a valid path. make sure that the path name is spelled correctly and that you are connected to the server on which the file resides

Error occurs in the Connection Failure dialog box after clicking Connect in the Connect to a Data Source dialog box.

The file location of the Microsoft Access database is incorrect.

Verify the location of the database file. If the database file is on a network drive, map to the network drive.

Modify the existing file location by selecting New > ODBC and selecting the existing database name from the ODBC Data Source Administrator dialog box. Then select Configure to change the database file location.

Microsoft® SQL Server®

The TCP/IP connection to the host hostname, port portnumber has failed. Error: “null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.”

Incorrect server name or port number.

Verify your database server name and your port number. Microsoft SQL Server uses a dynamic port for JDBC. Verify the value using Microsoft SQL Server Configuration Manager. For details, see Step 2. Verify the port number.

Microsoft SQL Server

This driver is not configured for integrated authentication.

The Microsoft SQL Server Windows authentication library is not added to javalibrarypath.txt.

Add the Microsoft SQL Server Windows authentication library to javalibrarypath.txt. For details about configuring a Microsoft SQL Server Authenticated Database Connection, see Microsoft SQL Server JDBC for Windows.

Microsoft SQL Server

Invalid string or buffer length.

64-bit ODBC driver error.

Use a JDBC driver or the native ODBC interface instead.

Microsoft SQL Server

JDBC Driver Error: com.microsoft.sqlserver.jdbc.SQLServerDriver.Driver Not Found/Loaded.

The full path to the JAR file was not added to the javaclasspath.txt file, or it was added using the javaaddpath command. Alternatively, the path to the JAR file is incorrect.

Ensure that the path to the JAR file is not misspelled. Ensure that you add the path to the static class path.

Microsoft SQL Server

com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit> WARNING: Failed to load the sqljdbc_auth.dll

The path to the folder containing the file sqljdbc_auth.dll was not added to the javalibrarypath.txt file. Or, the full path to the file was added instead of the path to the folder. This error also occurs when you add the path to the 32-bit version of the DLL using a 64-bit version of MATLAB.

Add the path to the folder containing the file sqljdbc_auth.dll to the javalibrarypath.txt file. For details about configuring a Microsoft SQL Server Authenticated Database Connection, see Microsoft SQL Server JDBC for Windows.

Microsoft SQL Server

Login failed for user 'DOMAIN\username'.

Either the login credentials you are using are incorrect or your user account does not have enough rights to access the remote machine. This error also occurs when the database server is not configured to accept Integrated Windows Authentication login credentials.

Ensure that your user name and password are correct. Refer to your system administrator for appropriate access rights to your machines. Contact your database administrator to see if your database is set up with Windows Authentication.

Microsoft SQL Server

MSSQLSERVER_numberThe Microsoft SQL Server driver returns a numbered error message.Find more information about the specific error in System Error Messages.

MySQL®

Access denied for user 'user'@'machinename' (using password: YES)

Incorrect user name and password combination.

Verify your user name and password.

MySQL

Communications link failure.
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Incorrect server name or port number.

Verify your database server name and port number.

MySQL

Unknown database 'databasename'.

Provided database name is incorrect.

Verify your database name.

MySQL

ERROR number (SQLSTATE): errormessageThe MySQL driver returns an error that contains an error number, a SQLSTATE value, and an error message.Navigate to the latest database documentation in the MySQL Documentation, and search for the specific error.

Oracle®

Error when connecting to Oracle oci8 database using JDBC driver: Error using com.mathworks.toolbox.database.databaseConnect/makeDatabaseConnection Java exception occurred: java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.pathat java.lang.ClassLoader.loadLibrary(Unknown Source)at java.lang.Runtime.loadLibrary0.......

MATLAB cannot find the Oracle DLL that the oci8 drivers need.

Add the path for the location of the Oracle DLLs to javalibrarypath.txt. For details, see Oracle JDBC for Windows.

Oracle

Invalid Oracle URL specified: OracleDataSource.makeURL

The DriverType parameter is not specified.

Specify the DriverType parameter as either thin for connecting without Windows authentication or oci for connecting with Windows authentication.

Oracle

The Network Adapter could not establish the connection.

Either Server or Portnumber is not specified or has an incorrect value.

Verify the server name and port number for your Oracle database.

Oracle

TNS:listener does not currently know of SID given in connect descriptor: Incorrect database name or incorrect URL.

The service name for your database is incorrect.

Verify the service name for your Oracle database.

Oracle

ORA-numberThe Oracle driver returns a numbered error message.Navigate to the latest database documentation in the Oracle Documentation, and search for the specific error.

See Also

Related Topics