I trying connect to mysql
db from VM
, with python
driver pymssql
.
_connection = mysql.connect(host="xxxxxx.database.windows.net", user='xxxxxx@xxxxxx',
password='xxxxx', database='xxxxxx')
But i get exeption like this
File "pymssql.pyx", line 641, in pymssql.connect (pymssql.c:10824) pymssql.OperationalError: (20002, b'DB-Lib error message 20002, severity 9:\\nAdaptive Server connection failed (my-xxxxx.database.windows.net:1433)\\n')
When I connecting to this database from my local pc all good.
PS I opened all ports for all protocols on my VM
Per my experience, Python pymssql
package is depended on freetds-common
package which will be installed when using sudo apt install python-pymssql
command to install it.
And for Azure SQL Database, you need to set the tds version with 7.3
, so please refer to my anser for the other similar SO thread pymssql: Connection to the database only works sometimes to check whether the freetds has been install and what the tds version in the configuration file /etc/freetds/freetds.conf
is.
Hope it 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.