Guest User

Untitled

a guest
Jul 23rd, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. pi@raspberrypi:~/Downloads $ tsql -C
  2. Compile-time settings (established with the "configure" script)
  3. Version: freetds v0.91
  4. freetds.conf directory: /etc/freetds
  5. MS db-lib source compatibility: no
  6. Sybase binary compatibility: yes
  7. Thread safety: yes
  8. iconv library: yes
  9. TDS version: 4.2
  10. iODBC: no
  11. unixodbc: yes
  12. SSPI "trusted" logins: no
  13. Kerberos: yes
  14.  
  15. [MyDB]
  16. host = host.database.windows.net
  17. port = 1433
  18. tds version = 7.0
  19. client charset = UTF-8
  20.  
  21. [FreeTDS]
  22. Description=FreeTDS Driver
  23. Driver=/usr/lib/arm-linux-gnueabihf/odbc/libtdsodbc.so
  24. Setup=/usr/lib/arm-linux-gnueabihf/odbc/libtdsS.so
  25. fileusage=1
  26. dontdlclose=1
  27. UsageCount=1
  28.  
  29. def connect():
  30. con = pymssql.connect(server,username,password,database)
  31. return con
  32.  
  33.  
  34. if __name__ == "__main__":
  35. server = 'tcp:host.database.windows.net,1433'
  36. database = 'testdb'
  37. username = 'username'
  38. password = 'password'
  39. driver = 'FreeTDS'
  40. con = connect()
  41.  
  42. pi@raspberrypi:~/Downloads $ python sql_connect.py
  43. Traceback (most recent call last):
  44. File "sql_connect.py", line 32, in <module>
  45. con = connect()
  46. File "sql_connect.py", line 5, in connect
  47. con = pymssql.connect(server,username,password,database)
  48. File "/usr/lib/pymodules/python2.7/pymssql.py", line 609, in connect
  49. raise InterfaceError, e[0]
  50. pymssql.InterfaceError: Connection to the database failed for an unknown reason.
  51.  
  52. pi@raspberrypi:~/Downloads $ tsql -H host.database.windows.net -p 1433 -U username -P password -D testdb
  53. locale is "en_GB.UTF-8"
  54. locale charset is "UTF-8"
  55. using default charset "UTF-8"
  56. Default database being set to testdb
  57. Error 20017 (severity 9):
  58. Unexpected EOF from the server
  59. OS error 115, "Operation now in progress"
  60. Error 20002 (severity 9):
  61. Adaptive Server connection failed
  62. There was a problem connecting to the server
Add Comment
Please, Sign In to add comment