简体   繁体   English

如何使用 py(py)odbc 从 python 连接到远程 MS SQL Server

[英]How to connect to remote MS SQL Server from python using py(py)odbc

I have a remote ms sql server at office location and I wanted to connect from an ubuntu desktop to it.我在办公室位置有一个远程 ms sql 服务器,我想从 ubuntu 桌面连接到它。 I installed DBeaver http://dbeaver.jkiss.org/ and it was working like a charm without any other dependency.我安装了 DBeaver http://dbeaver.jkiss.org/ ,它运行起来就像一个魅力,没有任何其他依赖。

After this I started to setup a connection from python with no success until I found a straightforward tutorial at https://tryolabs.com/blog/2012/06/25/connecting-sql-server-database-python-under-ubuntu/ .在此之后,我开始从 python 设置连接但没有成功,直到我在https://tryolabs.com/blog/2012/06/25/connecting-sql-server-database-python-under-ubuntu/找到了一个简单的教程. But this solution involved installing some packages to ubuntu itself and configuring some related config files in the system.但是这个解决方案涉及将一些包安装到ubuntu本身并在系统中配置一些相关的配置文件。

The question is if there is some python package to use without os dependencies?问题是是否有一些 python 包可以在没有 os 依赖的情况下使用?

I don't think you would be able to achieve what you want without installing some packages.我认为如果不安装一些软件包,您将无法实现您想要的。 Reason being you are connecting to the MSSQL which follows a different set of rules as it is from Microsoft.原因是您要连接到遵循与 Microsoft 不同的规则集的 MSSQL。

If you were connecting to any DB (MySQL,MongoDB etc) you still need to install a package or module to make it work.如果您连接到任何数据库(MySQL、MongoDB 等),您仍然需要安装一个包或模块才能使其工作。

Try to install the package as described in the tutorial from the like you shared and if you run into any problem paste the problem here.尝试按照您分享的教程中的说明安装软件包,如果遇到任何问题,请将问题粘贴到此处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Windows 7上的Python中使用PYODBC连接到远程MS SQL服务器 - Cant Connect to remote MS SQL server using PYODBC on Windows 7 in Python 如何使用FreeTDS ODBC连接到SQL Server - How to connect to SQL Server using FreeTDS ODBC 使用python从linux连接到MS SQL Server的最佳技术是什么? ODBC? - What's the best technology for connecting from linux to MS SQL Server using python? ODBC? 使用pyodbc将Python连接到MS SQL Server - Connect Python to MS SQL Server using pyodbc 如何使用 Python 和 Windows 身份验证从 WSL2 连接到非本地 MS SQL 服务器? - How to connect to non-local MS SQL Server from WSL2 using Python and Windows Authentication? 如何使用 discord.py bot 在 discord 服务器中远程命令 - how to remote command in discord server using discord.py bot 使用odbc_connect从SQLAlchemy连接到SQL Server - Connecting to SQL server from SQLAlchemy using odbc_connect 如何使用 JDBC 和 ZEA52C36203D5F99C3CE2ZB4 从 Python 连接远程 Hive 服务器? - How to connect a remote Hive server from Python using JDBC and SSL? 从 Python 连接到远程桌面上的 MS SQL 服务器 - Connecting to MS SQL Server on a remote desktop from Python 在sql server上运行python(.py脚本) - Running a python (.py script) on sql server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM