python pymssql error: 18456, b'DB-Lib error message 20010, severity 8:\nUnable to allocate sufficient memory

Viewed 887

I use pymssql to connect the sql server database with macOS,

import pandas as pd
import numpy as np 
from sqlalchemy import create_engine
import pymssql
conn = pymssql.connect(host='', port=1433, user='', password='', database='', charset='gbk')

if I set charset with 'utf8', it come out with error connection failed, if I set charset with 'gbk', it come out with error as below:

18456, b'DB-Lib error message 20010, severity 8:\nUnable to allocate sufficient memory

Where I use navicat to connect this sql server database work well.

1 Answers

When I removed the charset option, it worked.

The version info is:

SQL Server-2014

pymssql 2.2.1

OS win server 2012 r2

Related