简体   繁体   中英

Python: Error while connecting to SQL Server (ODBC 17)

Getting below error while executing SQL statement using pd.read_sql()

sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) ('08001', '[08001] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:0A0C0103:SSL routines::internal error] (-1) (SQLDriverConnect)')

Python version 3.10.8. Other packages:

  • pyodbc==4.0.35
  • pandas==1.5.2
  • pymysql==1.0.2
  • sqlalchemy==1.4.46

I want to execute the above command successfully.

The error message ' ODBC 17 ' distinctively specifies a failure in establishing a connection to a SQL Server database through ODBC driver. This can be caused by;

  1. Incorrect connection details such as server name, database name, username, and password.
  2. ODBC driver not installed or not properly configured on the machine.

In order to solve this, try and verify the connection details and ensure they are correct or Install or reinstall the ODBC driver and make sure it's properly configured.

If the above doesn't work, kindly check the firewall settings and ensure that the connection is not being blocked. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM