Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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.

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.

All JDBC-Compliant Databases

Unable to find JDBC driver file on MATLAB Java class path.

  • Path to the JDBC driver JAR file is not on the static or dynamic class path.

  • Incorrect driver name provided while using the 'driver' and 'url' syntax.

Verify that you added the path to your JDBC driver to the static or dynamic path. For an example, see MySQL JDBC for Windows.

Ensure that you provide the correct JDBC driver name for the driver and url input arguments. For an example, see SQLite JDBC for Windows.

All ODBC-Compliant Databases

[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 Configuring Driver and Data Source.

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

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

Was this topic helpful?