我正在尝试设置一个由Azure驱动的数据库,以供2sql使用。 在subunit2sql db setup步骤中,提到创建模式如下:
subunit2sql-db-manage --database-connection mysql://subunit:pass@127.0.0.1/subunit upgrade head
用mssql替换mysql选项卡,在创建到azuredb的odbcsdn连接之后-我能够看到数据库。你知道吗
但是,子单元2sql连接总是失败,跟踪如下。 我的理解是,我可能没有为alchemy/python使用正确的配置,但是这些消息让我很困惑,好像我使用isql for eg和SDN DB info可以很好地连接到它。你知道吗
我运行的命令是:
subunit2sql-db-manage --verbose --database-connection mssql://user:'pwd'@remote_host/DB upgrade head
我在/etc下有odbc配置/odbcinst.ini文件和/等/odbc.ini文件但是上述方法失败了: 奥斯陆_db.exception.DBError数据库异常: (pyodbc错误)('IM002','IM002][unixODBC][Driver Manager]未找到数据源名称,并且未指定默认驱动程序(0)(SQLDriverConnect)')
(抱歉,我不能在这里添加subuni2sql标记,因为我没有点数)
分享我的测试。希望有帮助。你知道吗
根据GitHub上的
subunit2sql
项目的requirements.txt
,该工具需要Python包SQLAlchemy
,因此我通过pymssql驱动程序引用对microsoftsql Server数据库的SQLAlchemydocument支持,用Azure SQL数据库连接字符串设置数据库连接,请参见下文。你知道吗注意:您可以在Azure portal上的SQL数据库连接字符串中找到变量
username
、password
、hostname
&;database
。你知道吗为了成功地连接SQL数据库,您需要在运行上述命令之前执行以下步骤。你知道吗
作为参考,我的环境是ubuntu14.04lts。你知道吗
配置
/etc/odbcinst.ini
文件,例如如下所示。你知道吗配置防火墙设置以添加客户端ip,请参阅https://azure.microsoft.com/en-us/documentation/articles/sql-database-configure-firewall-settings/。
虽然我得到的错误信息如下,成功地连接了SQL数据库。你知道吗
相关问题 更多 >
编程相关推荐