Macos(经过了两天,无数次的方法验证,寻找各种资料,总结如下)
brew install freetds@0.91 如果出现错误就进行手工安装,也可以直接使用 brew install freetds安装最新版本(测试通过)
brew install freedts@0.91
出错。
linql@linqldeMBP-2 / % brew install freetds@0.91
Warning: No available formula with the name "freetds@0.91". Did you mean freetds?
==> Searching for similarly named formulae...
This similarly named formula was found:
freetds
To install it, run:brew install freetds
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps
手工安装,下载文件
解决freetds安装问题
下载fresstds,下载链接:http://mirrors.ibiblio.org/freetds/stable/
1、tar -xvf freetds-0.91.tar.gz
2、cd freetds-0.91
3、./configure --prefix=/usr/local/freetds0.91 --enable-msdblib --with-tdsver=7.1
4、make
5、sudo make install
6、brew link --force freetds@0.91
7、tsql -C 查看信息
(base) lizhongsu@lizhongdeMacBook-Air 0.91.49 % tsql -C
Compile-time settings (established with the "configure" script)Version: freetds v0.91.49freetds.conf directory: /usr/local/Cellar/freetds/0.91.49/etcMS db-lib source compatibility: noSybase binary compatibility: noThread safety: yesiconv library: yesTDS version: 5.0iODBC: nounixodbc: noSSPI "trusted" logins: noKerberos: no
8、pip3 install pymssql (安装的是2.2.9版本,最新版本)
9、修改配置文件macos(这一步是关键,之前就是没有修改这一环节,造成大量时间研究,我使用的是SQLServer 2008版本,tds version = 7.0 )
pymssql needs freetds to work properly. On macOS,
open /usr/local/etc/freetds.conf in your preferred text editor,
and update the following configuration:[global]
# TDS protocol version
# tds version = auto
tds version = 7.0
Python 代码
"""
Connects to a SQL database using pymssql
"""
import pymssqlimport os
os.environ['TDSDUMP'] = 'stdout'
conn = pymssql.connect(host='数据库主机',server='.',port='端口',user='用户',password='密码7',database='数据库',as_dict=True,charset="CP936"
)# 创建游标对象
cursor = conn.cursor()# 执行SQL查询
cursor.execute('SELECT * FROM allloginuser')# 获取查询结果
result = cursor.fetchall()# 打印查询结果
for row in result:print(row)# 关闭连接
conn.close()
执行结果
/Users/lizhongsu/PycharmProjects/printTable/venv/bin/python /Users/lizhongsu/PycharmProjects/printTable/sqlMssql.py
log.c:196:Starting log file for FreeTDS 0.91.49on 2023-10-18 22:54:05 with debug flags 0x4fff.
config.c:714:Setting 'dump_file' to 'stdout' from $TDSDUMP.
iconv.c:330:tds_iconv_open(0x7f93f470dec0, CP936)
iconv.c:187:local name for ISO-8859-1 is ISO-8859-1
iconv.c:187:local name for UTF-8 is UTF-8
iconv.c:187:local name for UCS-2LE is UCS-2LE
iconv.c:187:local name for UCS-2BE is UCS-2BE
iconv.c:349:setting up conversions for client charset "CP936"
iconv.c:351:preparing iconv for "CP936" <-> "UCS-2LE" conversion
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
iconv.c:394:tds_iconv_open: done
net.c:205:Connecting to 8.142.130.213 port 28991 (TDS version 7.0)
net.c:270:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:310:tds_open_socket() succeeded
util.c:156:Changed query state from DEAD to IDLE
login.c:782:quietly sending TDS 7+ login packet
token.c:328:tds_process_login_tokens()
net.c:555:Received header
0000 04 01 01 b0 00 37 01 00- |...�.7..|net.c:609:Received packet
0000 04 01 01 b0 00 37 01 00-e3 25 00 01 0b 68 00 68 |...�.7.. �%...h.h|
0010 00 65 00 72 00 70 00 6d-00 61 00 73 00 74 00 65 |.e.r.p.m .a.s.t.e|
0020 00 72 00 06 6d 00 61 00-73 00 74 00 65 00 72 00 |.r..m.a. s.t.e.r.|
0030 ab 5e 00 45 16 00 00 02-00 1a 00 f2 5d 06 5c 70 |�^.E.... ...�].\p|
0040 65 6e 63 93 5e 0a 4e 0b-4e 87 65 f4 66 39 65 3a |enc.^.N. N.e�f9e:|
0050 4e 20 00 27 00 68 00 68-00 65 00 72 00 70 00 6d |N .'.h.h .e.r.p.m|
0060 00 61 00 73 00 74 00 65-00 72 00 27 00 02 30 0f |.a.s.t.e .r.'..0.|
0070 69 00 5a 00 6d 00 6e 00-61 00 31 00 33 00 31 00 |i.Z.m.n. a.1.3.1.|
0080 63 00 36 00 7a 00 32 00-6a 00 6d 00 5a 00 00 01 |c.6.z.2. j.m.Z...|
0090 00 e3 17 00 02 0a 75 00-73 00 5f 00 65 00 6e 00 |.�....u. s._.e.n.|
00a0 67 00 6c 00 69 00 73 00-68 00 00 ab 78 00 47 16 |g.l.i.s. h..�x.G.|
00b0 00 00 01 00 27 00 43 00-68 00 61 00 6e 00 67 00 |....'.C. h.a.n.g.|
00c0 65 00 64 00 20 00 6c 00-61 00 6e 00 67 00 75 00 |e.d. .l. a.n.g.u.|
00d0 61 00 67 00 65 00 20 00-73 00 65 00 74 00 74 00 |a.g.e. . s.e.t.t.|
00e0 69 00 6e 00 67 00 20 00-74 00 6f 00 20 00 75 00 |i.n.g. . t.o. .u.|
00f0 73 00 5f 00 65 00 6e 00-67 00 6c 00 69 00 73 00 |s._.e.n. g.l.i.s.|
0100 68 00 2e 00 0f 69 00 5a-00 6d 00 6e 00 61 00 31 |h....i.Z .m.n.a.1|
0110 00 33 00 31 00 63 00 36-00 7a 00 32 00 6a 00 6d |.3.1.c.6 .z.2.j.m|
0120 00 5a 00 00 01 00 e3 0f-00 03 05 63 00 70 00 39 |.Z....�. ...c.p.9|
0130 00 33 00 36 00 01 00 00-e3 0b 00 05 04 32 00 30 |.3.6.... �....2.0|
0140 00 35 00 32 00 00 e3 0f-00 06 06 31 00 39 00 36 |.5.2..�. ...1.9.6|
0150 00 36 00 30 00 39 00 00-ad 36 00 01 07 00 00 00 |.6.0.9.. �6......|
0160 16 4d 00 69 00 63 00 72-00 6f 00 73 00 6f 00 66 |.M.i.c.r .o.s.o.f|
0170 00 74 00 20 00 53 00 51-00 4c 00 20 00 53 00 65 |.t. .S.Q .L. .S.e|
0180 00 72 00 76 00 65 00 72-00 00 00 00 00 0a 32 06 |.r.v.e.r ......2.|
0190 40 e3 13 00 04 04 34 00-30 00 39 00 36 00 04 34 |@�....4. 0.9.6..4|
01a0 00 30 00 39 00 36 00 fd-00 00 00 00 00 00 00 00 |.0.9.6.� ........|token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
dblib.c:327:db_env_chg(0x7f93f470dec0, 1, master, hherpmaster)
token.c:337:looking for login token, got ab(INFO)
token.c:122:tds_process_default_tokens() marker is ab(INFO)
token.c:2588:tds_process_msg() reading message 5701 from server
token.c:2661:tds_process_msg() calling client msg handler
dbutil.c:85:_dblib_handle_info_message(0x7f93f470aca0, 0x7f93f470dec0, 0x7ffeef4fec30)
dbutil.c:86:msgno 5701: "�ѽ����ݿ������ĸ���Ϊ 'hherpmaster'��"
token.c:2674:tds_process_msg() returning TDS_SUCCEED
token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
dblib.c:327:db_env_chg(0x7f93f470dec0, 2, , us_english)
token.c:337:looking for login token, got ab(INFO)
token.c:122:tds_process_default_tokens() marker is ab(INFO)
token.c:2588:tds_process_msg() reading message 5703 from server
token.c:2661:tds_process_msg() calling client msg handler
dbutil.c:85:_dblib_handle_info_message(0x7f93f470aca0, 0x7f93f470dec0, 0x7ffeef4fec30)
dbutil.c:86:msgno 5703: "Changed language setting to us_english."
token.c:2674:tds_process_msg() returning TDS_SUCCEED
token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
token.c:2493:server indicated charset change to "cp936"
iconv.c:988:setting server single-byte charset to "CP936"
dblib.c:327:db_env_chg(0x7f93f470dec0, 3, , cp936)
token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
dblib.c:327:db_env_chg(0x7f93f470dec0, 5, , 2052)
token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
dblib.c:327:db_env_chg(0x7f93f470dec0, 6, , 196609)
token.c:337:looking for login token, got ad(LOGINACK)
token.c:373:server reports TDS version 7.0.0.0
token.c:375:Product name for 0x7000000 is 7.0
token.c:337:looking for login token, got e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
token.c:2477:changing block size from 4096 to 4096
dblib.c:327:db_env_chg(0x7f93f470dec0, 4, 4096, 4096)
token.c:337:looking for login token, got fd(DONE)
token.c:122:tds_process_default_tokens() marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
token.c:2370: rows_affected = 0
token.c:438:tds_process_login_tokens() returning TDS_SUCCEED
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to QUERYING
write.c:140:tds_put_string converting 19 bytes of "set textsize 64512 "
write.c:168:tds_put_string wrote 38 bytes
util.c:156:Changed query state from QUERYING to PENDING
net.c:741:Sending packet
0000 01 01 00 2e 00 00 00 00-73 00 65 00 74 00 20 00 |........ s.e.t. .|
0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00 |t.e.x.t. s.i.z.e.|
0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00 | .6.4.5. 1.2. .|token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4fed10, 0x7ffeef4fed14, 0x100)
util.c:156:Changed query state from PENDING to READING
net.c:555:Received header
0000 04 01 00 11 00 37 01 00- |.....7..|net.c:609:Received packet
0000 04 01 00 11 00 37 01 00-fd 00 00 be 00 00 00 00 |.....7.. �..�....|
0010 00 - |.|token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
util.c:156:Changed query state from READING to IDLE
token.c:2370: rows_affected = 0
util.c:104:logic error: cannot change query state from IDLE to PENDING
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4fed10, 0x7ffeef4fed14, 0x100)
token.c:543:tds_process_tokens() state is COMPLETED
dblib.c:239:dblib_add_connection(0x100f8e430, 0x7f93f470dec0)
dblib.c:739:dbloginfree(0x7f93f470fc30)
dblib.c:1312:dbcmd(0x7f93f4717dd0, SET ARITHABORT ON;SET CONCAT_NULL_YIELDS_NULL ON;SET ANSI_NULLS ON;SET ANSI_NULL_DFLT_ON ON;SET ANSI_PADDING ON;SET ANSI_WARNINGS ON;SET ANSI_NULL_DFLT_ON ON;SET CURSOR_CLOSE_ON_COMMIT ON;SET QUOTED_IDENTIFIER ON;SET TEXTSIZE 2147483647;)
dblib.c:1319:dbcmd() bufsz = 0
dblib.c:6862:dbsqlsend(0x7f93f4717dd0)
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to QUERYING
write.c:140:tds_put_string converting 237 bytes of "SET ARITHABORT ON;SET CONCAT_NULL_YIELDS_NULL ON;SET ANSI_NULLS ON;SET ANSI_NULL_DFLT_ON ON;SET ANSI_PADDING ON;SET ANSI_WARNINGS ON;SET ANSI_NULL_DFLT_ON ON;SET CURSOR_CLOSE_ON_COMMIT ON;SET QUOTED_IDENTIFIER ON;SET TEXTSIZE 2147483647;"
write.c:140:tds_put_string converting 109 bytes of "S ON;SET ANSI_NULL_DFLT_ON ON;SET CURSOR_CLOSE_ON_COMMIT ON;SET QUOTED_IDENTIFIER ON;SET TEXTSIZE 2147483647;"
write.c:168:tds_put_string wrote 474 bytes
util.c:156:Changed query state from QUERYING to PENDING
net.c:741:Sending packet
0000 01 01 01 e2 00 00 01 00-53 00 45 00 54 00 20 00 |...�.... S.E.T. .|
0010 41 00 52 00 49 00 54 00-48 00 41 00 42 00 4f 00 |A.R.I.T. H.A.B.O.|
0020 52 00 54 00 20 00 4f 00-4e 00 3b 00 53 00 45 00 |R.T. .O. N.;.S.E.|
0030 54 00 20 00 43 00 4f 00-4e 00 43 00 41 00 54 00 |T. .C.O. N.C.A.T.|
0040 5f 00 4e 00 55 00 4c 00-4c 00 5f 00 59 00 49 00 |_.N.U.L. L._.Y.I.|
0050 45 00 4c 00 44 00 53 00-5f 00 4e 00 55 00 4c 00 |E.L.D.S. _.N.U.L.|
0060 4c 00 20 00 4f 00 4e 00-3b 00 53 00 45 00 54 00 |L. .O.N. ;.S.E.T.|
0070 20 00 41 00 4e 00 53 00-49 00 5f 00 4e 00 55 00 | .A.N.S. I._.N.U.|
0080 4c 00 4c 00 53 00 20 00-4f 00 4e 00 3b 00 53 00 |L.L.S. . O.N.;.S.|
0090 45 00 54 00 20 00 41 00-4e 00 53 00 49 00 5f 00 |E.T. .A. N.S.I._.|
00a0 4e 00 55 00 4c 00 4c 00-5f 00 44 00 46 00 4c 00 |N.U.L.L. _.D.F.L.|
00b0 54 00 5f 00 4f 00 4e 00-20 00 4f 00 4e 00 3b 00 |T._.O.N. .O.N.;.|
00c0 53 00 45 00 54 00 20 00-41 00 4e 00 53 00 49 00 |S.E.T. . A.N.S.I.|
00d0 5f 00 50 00 41 00 44 00-44 00 49 00 4e 00 47 00 |_.P.A.D. D.I.N.G.|
00e0 20 00 4f 00 4e 00 3b 00-53 00 45 00 54 00 20 00 | .O.N.;. S.E.T. .|
00f0 41 00 4e 00 53 00 49 00-5f 00 57 00 41 00 52 00 |A.N.S.I. _.W.A.R.|
0100 4e 00 49 00 4e 00 47 00-53 00 20 00 4f 00 4e 00 |N.I.N.G. S. .O.N.|
0110 3b 00 53 00 45 00 54 00-20 00 41 00 4e 00 53 00 |;.S.E.T. .A.N.S.|
0120 49 00 5f 00 4e 00 55 00-4c 00 4c 00 5f 00 44 00 |I._.N.U. L.L._.D.|
0130 46 00 4c 00 54 00 5f 00-4f 00 4e 00 20 00 4f 00 |F.L.T._. O.N. .O.|
0140 4e 00 3b 00 53 00 45 00-54 00 20 00 43 00 55 00 |N.;.S.E. T. .C.U.|
0150 52 00 53 00 4f 00 52 00-5f 00 43 00 4c 00 4f 00 |R.S.O.R. _.C.L.O.|
0160 53 00 45 00 5f 00 4f 00-4e 00 5f 00 43 00 4f 00 |S.E._.O. N._.C.O.|
0170 4d 00 4d 00 49 00 54 00-20 00 4f 00 4e 00 3b 00 |M.M.I.T. .O.N.;.|
0180 53 00 45 00 54 00 20 00-51 00 55 00 4f 00 54 00 |S.E.T. . Q.U.O.T.|
0190 45 00 44 00 5f 00 49 00-44 00 45 00 4e 00 54 00 |E.D._.I. D.E.N.T.|
01a0 49 00 46 00 49 00 45 00-52 00 20 00 4f 00 4e 00 |I.F.I.E. R. .O.N.|
01b0 3b 00 53 00 45 00 54 00-20 00 54 00 45 00 58 00 |;.S.E.T. .T.E.X.|
01c0 54 00 53 00 49 00 5a 00-45 00 20 00 32 00 31 00 |T.S.I.Z. E. .2.1.|
01d0 34 00 37 00 34 00 38 00-33 00 36 00 34 00 37 00 |4.7.4.8. 3.6.4.7.|
01e0 3b 00 - |;.|dblib.c:4639:dbsqlok(0x7f93f4717dd0)
dblib.c:4669:dbsqlok() not done, calling tds_process_tokens()
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff114, 0x7ffeef4ff124, 0x6914)
util.c:156:Changed query state from PENDING to READING
net.c:555:Received header
0000 04 01 00 59 00 37 01 00- |...Y.7..|net.c:609:Received packet
0000 04 01 00 59 00 37 01 00-fd 01 00 b9 00 00 00 00 |...Y.7.. �..�....|
0010 00 fd 01 00 b9 00 00 00-00 00 fd 01 00 b9 00 00 |.�..�... ..�..�..|
0020 00 00 00 fd 01 00 b9 00-00 00 00 00 fd 01 00 b9 |...�..�. ....�..�|
0030 00 00 00 00 00 fd 01 00-b9 00 00 00 00 00 fd 01 |.....�.. �.....�.|
0040 00 b9 00 00 00 00 00 fd-01 00 b9 00 00 00 00 00 |.�.....� ..�.....|
0050 fd 00 00 be 00 00 00 00-00 |�..�.... .|token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
util.c:156:Changed query state from READING to PENDING
dblib.c:4707:dbsqlok() end status is SUCCEED
dblib.c:4718:dbsqlok() end status was success
dblib.c:3196:dbcancel(0x7f93f4717dd0)
query.c:2155:tds_send_cancel: not in_cancel and not idle
query.c:2164:tds_send_cancel: sending cancel packet
net.c:741:Sending packet
0000 06 01 00 08 00 00 01 00- |........|token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff13c, 0x0, 0x0)
util.c:156:Changed query state from PENDING to READING
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 1was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 0
token.c:2370: rows_affected = 0
net.c:555:Received header
0000 04 01 00 11 00 37 01 00- |.....7..|net.c:609:Received packet
0000 04 01 00 11 00 37 01 00-fd 20 00 fd 00 00 00 00 |.....7.. � .�....|
0010 00 - |.|token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 1error = 0done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
util.c:156:Changed query state from READING to IDLE
token.c:2370: rows_affected = 0
dblib.c:1398:dbuse(0x7f93f4717dd0, hherpmaster)
dblib.c:1312:dbcmd(0x7f93f4717dd0, use [hherpmaster])
dblib.c:1319:dbcmd() bufsz = 238
dblib.c:5882:dbfreebuf(0x7f93f4717dd0)
dblib.c:1369:dbsqlexec(0x7f93f4717dd0)
dblib.c:6862:dbsqlsend(0x7f93f4717dd0)
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to QUERYING
write.c:140:tds_put_string converting 17 bytes of "use [hherpmaster]"
write.c:168:tds_put_string wrote 34 bytes
util.c:156:Changed query state from QUERYING to PENDING
net.c:741:Sending packet
0000 01 01 00 2a 00 00 01 00-75 00 73 00 65 00 20 00 |...*.... u.s.e. .|
0010 5b 00 68 00 68 00 65 00-72 00 70 00 6d 00 61 00 |[.h.h.e. r.p.m.a.|
0020 73 00 74 00 65 00 72 00-5d 00 |s.t.e.r. ].|dblib.c:4639:dbsqlok(0x7f93f4717dd0)
dblib.c:4669:dbsqlok() not done, calling tds_process_tokens()
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff0b4, 0x7ffeef4ff0c4, 0x6914)
util.c:156:Changed query state from PENDING to READING
net.c:555:Received header
0000 04 01 00 c4 00 37 01 00- |...�.7..|net.c:609:Received packet
0000 04 01 00 c4 00 37 01 00-e3 2f 00 01 0b 68 00 68 |...�.7.. �/...h.h|
0010 00 65 00 72 00 70 00 6d-00 61 00 73 00 74 00 65 |.e.r.p.m .a.s.t.e|
0020 00 72 00 0b 68 00 68 00-65 00 72 00 70 00 6d 00 |.r..h.h. e.r.p.m.|
0030 61 00 73 00 74 00 65 00-72 00 ab 7e 00 45 16 00 |a.s.t.e. r.�~.E..|
0040 00 01 00 2a 00 43 00 68-00 61 00 6e 00 67 00 65 |...*.C.h .a.n.g.e|
0050 00 64 00 20 00 64 00 61-00 74 00 61 00 62 00 61 |.d. .d.a .t.a.b.a|
0060 00 73 00 65 00 20 00 63-00 6f 00 6e 00 74 00 65 |.s.e. .c .o.n.t.e|
0070 00 78 00 74 00 20 00 74-00 6f 00 20 00 27 00 68 |.x.t. .t .o. .'.h|
0080 00 68 00 65 00 72 00 70-00 6d 00 61 00 73 00 74 |.h.e.r.p .m.a.s.t|
0090 00 65 00 72 00 27 00 2e-00 0f 69 00 5a 00 6d 00 |.e.r.'.. ..i.Z.m.|
00a0 6e 00 61 00 31 00 33 00-31 00 63 00 36 00 7a 00 |n.a.1.3. 1.c.6.z.|
00b0 32 00 6a 00 6d 00 5a 00-00 01 00 fd 00 00 e2 00 |2.j.m.Z. ...�..�.|
00c0 00 00 00 00 - |....|token.c:555:processing result tokens. marker is e3(ENVCHANGE)
token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE)
dblib.c:327:db_env_chg(0x7f93f470dec0, 1, hherpmaster, hherpmaster)
token.c:555:processing result tokens. marker is ab(INFO)
token.c:122:tds_process_default_tokens() marker is ab(INFO)
token.c:2588:tds_process_msg() reading message 5701 from server
token.c:2661:tds_process_msg() calling client msg handler
dbutil.c:85:_dblib_handle_info_message(0x7f93f470aca0, 0x7f93f470dec0, 0x7ffeef4fef30)
dbutil.c:86:msgno 5701: "Changed database context to 'hherpmaster'."
token.c:2674:tds_process_msg() returning TDS_SUCCEED
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
util.c:156:Changed query state from READING to IDLE
token.c:2370: rows_affected = 0
util.c:104:logic error: cannot change query state from IDLE to PENDING
dblib.c:4707:dbsqlok() end status is SUCCEED
dblib.c:4718:dbsqlok() end status was success
dblib.c:1668:dbresults(0x7f93f4717dd0)
dblib.c:1674:dbresults: dbresults_state is 5 (_DB_RES_SUCCEED)
dblib.c:1657:dbresults returning 1 (SUCCEED)
dblib.c:5854:dbcanquery(0x7f93f4717dd0)
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff10c, 0x0, 0x108)
token.c:543:tds_process_tokens() state is COMPLETED
dblib.c:3196:dbcancel(0x7f93f4717dd0)
query.c:2155:tds_send_cancel: not in_cancel and idle
dblib.c:1312:dbcmd(0x7f93f4717dd0, BEGIN TRAN)
dblib.c:1319:dbcmd() bufsz = 18
dblib.c:5882:dbfreebuf(0x7f93f4717dd0)
dblib.c:6862:dbsqlsend(0x7f93f4717dd0)
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to QUERYING
write.c:140:tds_put_string converting 10 bytes of "BEGIN TRAN"
write.c:168:tds_put_string wrote 20 bytes
util.c:156:Changed query state from QUERYING to PENDING
net.c:741:Sending packet
0000 01 01 00 1c 00 00 01 00-42 00 45 00 47 00 49 00 |........ B.E.G.I.|
0010 4e 00 20 00 54 00 52 00-41 00 4e 00 |N. .T.R. A.N.|dblib.c:4639:dbsqlok(0x7f93f4717dd0)
dblib.c:4669:dbsqlok() not done, calling tds_process_tokens()
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff0f4, 0x7ffeef4ff104, 0x6914)
util.c:156:Changed query state from PENDING to READING
net.c:555:Received header
0000 04 01 00 11 00 37 01 00- |.....7..|net.c:609:Received packet
0000 04 01 00 11 00 37 01 00-fd 00 00 d4 00 00 00 00 |.....7.. �..�....|
0010 00 - |.|token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
util.c:156:Changed query state from READING to IDLE
token.c:2370: rows_affected = 0
util.c:104:logic error: cannot change query state from IDLE to PENDING
dblib.c:4707:dbsqlok() end status is SUCCEED
dblib.c:4718:dbsqlok() end status was success
dblib.c:1668:dbresults(0x7f93f4717dd0)
dblib.c:1674:dbresults: dbresults_state is 5 (_DB_RES_SUCCEED)
dblib.c:1657:dbresults returning 1 (SUCCEED)
dblib.c:2761:dbcount(0x7f93f4717dd0)
dblib.c:3196:dbcancel(0x7f93f4717dd0)
query.c:2155:tds_send_cancel: not in_cancel and idle
dblib.c:3196:dbcancel(0x7f93f4717dd0)
query.c:2155:tds_send_cancel: not in_cancel and idle
dblib.c:1312:dbcmd(0x7f93f4717dd0, SELECT * FROM allloginuser)
dblib.c:1319:dbcmd() bufsz = 11
dblib.c:5882:dbfreebuf(0x7f93f4717dd0)
dblib.c:6862:dbsqlsend(0x7f93f4717dd0)
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to QUERYING
write.c:140:tds_put_string converting 26 bytes of "SELECT * FROM allloginuser"
write.c:168:tds_put_string wrote 52 bytes
util.c:156:Changed query state from QUERYING to PENDING
net.c:741:Sending packet
0000 01 01 00 3c 00 00 01 00-53 00 45 00 4c 00 45 00 |...<.... S.E.L.E.|
0010 43 00 54 00 20 00 2a 00-20 00 46 00 52 00 4f 00 |C.T. .*. .F.R.O.|
0020 4d 00 20 00 61 00 6c 00-6c 00 6c 00 6f 00 67 00 |M. .a.l. l.l.o.g.|
0030 69 00 6e 00 75 00 73 00-65 00 72 00 |i.n.u.s. e.r.|dblib.c:4639:dbsqlok(0x7f93f4717dd0)
dblib.c:4669:dbsqlok() not done, calling tds_process_tokens()
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff324, 0x7ffeef4ff334, 0x6914)
util.c:156:Changed query state from PENDING to READING
net.c:555:Received header
0000 04 01 01 13 00 37 01 00- |.....7..|net.c:609:Received packet
0000 04 01 01 13 00 37 01 00-81 08 00 00 00 10 00 38 |.....7.. .......8|
0010 08 61 00 6c 00 75 00 4f-00 72 00 64 00 65 00 72 |.a.l.u.O .r.d.e.r|
0020 00 00 00 08 00 a7 32 00-08 7a 00 74 00 44 00 42 |.....�2. .z.t.D.B|
0030 00 4e 00 61 00 6d 00 65-00 00 00 08 00 a7 32 00 |.N.a.m.e .....�2.|
0040 0a 7a 00 74 00 46 00 75-00 6c 00 6c 00 4e 00 61 |.z.t.F.u .l.l.N.a|
0050 00 6d 00 65 00 00 00 08-00 a7 50 00 07 65 00 74 |.m.e.... .�P..e.t|
0060 00 79 00 70 00 65 00 49-00 64 00 00 00 08 00 a7 |.y.p.e.I .d.....�|
0070 50 00 09 65 00 74 00 79-00 70 00 65 00 43 00 6f |P..e.t.y .p.e.C.o|
0080 00 64 00 65 00 00 00 08-00 a7 50 00 09 65 00 74 |.d.e.... .�P..e.t|
0090 00 79 00 70 00 65 00 4e-00 61 00 6d 00 65 00 00 |.y.p.e.N .a.m.e..|
00a0 00 09 00 a7 32 00 08 70-00 61 00 73 00 73 00 57 |...�2..p .a.s.s.W|
00b0 00 6f 00 72 00 64 00 00-00 09 00 a7 14 00 05 4b |.o.r.d.. ...�...K|
00c0 00 65 00 79 00 4e 00 6f-00 d1 01 00 00 00 06 00 |.e.y.N.o .�......|
00d0 79 61 6e 73 68 69 14 00-79 61 6e 73 68 69 28 bb |yanshi.. yanshi(�|
00e0 d4 bb cd d1 dd ca be d5-cb cc d7 29 05 00 30 30 |Ի���ʾ� ���)..00|
00f0 30 30 30 09 00 30 30 30-30 30 30 30 30 30 06 00 |000..000 000000..|
0100 b9 dc c0 ed d4 b1 00 00-00 00 fd 10 00 c1 00 01 |����Ա.. ..�..�..|
0110 00 00 00 - |...|token.c:555:processing result tokens. marker is 81(TDS7_RESULT)
token.c:1515:processing TDS7 result metadata.
mem.c:615:tds_free_all_results()
token.c:1540:set current_results (8 columns) to tds->res_info
token.c:1547:setting up 8 columns
token.c:1486:tds7_get_data_info: colname = aluOrder (8 bytes)type = 56 (int)server's type = 56 (int)column_varint_size = 0column_size = 4 (4 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 50Client charset: CP936Client column_size: 100
token.c:1486:tds7_get_data_info: colname = ztDBName (8 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 100 (50 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 50Client charset: CP936Client column_size: 100
token.c:1486:tds7_get_data_info: colname = ztFullName (10 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 100 (50 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 80Client charset: CP936Client column_size: 160
token.c:1486:tds7_get_data_info: colname = etypeId (7 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 160 (80 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 80Client charset: CP936Client column_size: 160
token.c:1486:tds7_get_data_info: colname = etypeCode (9 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 160 (80 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 80Client charset: CP936Client column_size: 160
token.c:1486:tds7_get_data_info: colname = etypeName (9 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 160 (80 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 50Client charset: CP936Client column_size: 100
token.c:1486:tds7_get_data_info: colname = passWord (8 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 100 (50 on server)
token.c:3420:adjust_character_column_size:Server charset: CP936Server column_size: 20Client charset: CP936Client column_size: 40
token.c:1486:tds7_get_data_info: colname = KeyNo (5 bytes)type = 39 (varchar)server's type = 167 (xvarchar)column_varint_size = 2column_size = 40 (20 on server)
token.c:1556: name size/wsize type/wtype utype
token.c:1557: -------------------- --------------- --------------- -------
token.c:1567: aluOrder 4/4 56/56 0
token.c:1567: ztDBName 100/50 39/167 0
token.c:1567: ztFullName 100/50 39/167 0
token.c:1567: etypeId 160/80 39/167 0
token.c:1567: etypeCode 160/80 39/167 0
token.c:1567: etypeName 160/80 39/167 0
token.c:1567: passWord 100/50 39/167 0
token.c:1567: KeyNo 40/20 39/167 0
util.c:156:Changed query state from READING to PENDING
dblib.c:4700:dbsqlok() found result token
dblib.c:1668:dbresults(0x7f93f4717dd0)
dblib.c:1674:dbresults: dbresults_state is 1 (_DB_RES_RESULTSET_EMPTY)
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff2d4, 0x7ffeef4ff2d0, 0x6914)
util.c:156:Changed query state from PENDING to READING
token.c:555:processing result tokens. marker is d1(ROW)
token.c:666:tds_process_tokens::SET_RETURN stopping on current token
util.c:156:Changed query state from READING to PENDING
dblib.c:1695:dbresults() tds_process_tokens returned 1 (TDS_SUCCEED),result_type TDS_ROW_RESULT
dblib.c:1657:dbresults returning 1 (SUCCEED)
dblib.c:1813:dbnumcols(0x7f93f4717dd0)
dblib.c:2761:dbcount(0x7f93f4717dd0)
dblib.c:1813:dbnumcols(0x7f93f4717dd0)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 1)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 1)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 2)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 2)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 3)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 3)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 4)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 4)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 5)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 5)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 6)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 6)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 7)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 7)
dblib.c:1839:dbcolname(0x7f93f4717dd0, 8)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 8)
dblib.c:2018:dbnextrow(0x7f93f4717dd0)
dblib.c:2031:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS)
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff454, 0x0, 0x1508)
util.c:156:Changed query state from PENDING to READING
token.c:555:processing result tokens. marker is d1(ROW)
token.c:2304:tds_process_row(): reading column 0
token.c:2049:tds_get_data: type 56, varint size 0
token.c:2110:tds_get_data(): wire column size is 4
token.c:2304:tds_process_row(): reading column 1
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 6
token.c:2304:tds_process_row(): reading column 2
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 20
token.c:2304:tds_process_row(): reading column 3
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 5
token.c:2304:tds_process_row(): reading column 4
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 9
token.c:2304:tds_process_row(): reading column 5
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 6
token.c:2304:tds_process_row(): reading column 6
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 0
token.c:2304:tds_process_row(): reading column 7
token.c:2049:tds_get_data: type 39, varint size 2
token.c:2110:tds_get_data(): wire column size is 0
util.c:156:Changed query state from READING to PENDING
buffering.h:306:buffer_transfer_bound_data(0x7f93f4717de0 4040 -1 0x7f93f4717dd0 0)
dblib.c:2100:leaving dbnextrow() returning REG_ROW/MORE_ROWS
dblib.c:3162:dbdata(0x7f93f4717dd0, 1)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 1)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 1)
dblib.c:3142:dbdatlen() type = 56, len= 4
dblib.c:3162:dbdata(0x7f93f4717dd0, 2)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 2)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 2)
dblib.c:3142:dbdatlen() type = 39, len= 6
dblib.c:3162:dbdata(0x7f93f4717dd0, 3)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 3)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 3)
dblib.c:3142:dbdatlen() type = 39, len= 20
dblib.c:3162:dbdata(0x7f93f4717dd0, 4)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 4)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 4)
dblib.c:3142:dbdatlen() type = 39, len= 5
dblib.c:3162:dbdata(0x7f93f4717dd0, 5)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 5)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 5)
dblib.c:3142:dbdatlen() type = 39, len= 9
dblib.c:3162:dbdata(0x7f93f4717dd0, 6)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 6)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 6)
dblib.c:3142:dbdatlen() type = 39, len= 6
dblib.c:3162:dbdata(0x7f93f4717dd0, 7)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 7)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 7)
dblib.c:3142:dbdatlen() type = 39, len= 0
dblib.c:3162:dbdata(0x7f93f4717dd0, 8)
dblib.c:2831:dbcoltype(0x7f93f4717dd0, 8)
dblib.c:3133:dbdatlen(0x7f93f4717dd0, 8)
dblib.c:3142:dbdatlen() type = 39, len= 0
dblib.c:2018:dbnextrow(0x7f93f4717dd0)
dblib.c:2031:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS)
token.c:540:tds_process_tokens(0x7f93f470dec0, 0x7ffeef4ff454, 0x0, 0x1508)
util.c:156:Changed query state from PENDING to READING
token.c:555:processing result tokens. marker is fd(DONE)
token.c:2339:tds_process_end: more_results = 0was_cancelled = 0error = 0done_count_valid = 1
token.c:2355:tds_process_end() state set to TDS_IDLE
util.c:156:Changed query state from READING to IDLE
token.c:2370: rows_affected = 1
util.c:104:logic error: cannot change query state from IDLE to PENDING
dblib.c:2100:leaving dbnextrow() returning NO_MORE_ROWS
dblib.c:2761:dbcount(0x7f93f4717dd0)
{'aluOrder': 1, 'ztDBName': 'yanshi', 'ztFullName': 'yanshi(辉煌演示账套)', 'etypeId': '00000', 'etypeCode': '000000000', 'etypeName': '管理员', 'passWord': '', 'KeyNo': ''}
dblib.c:1443:dbclose(0x7f93f4717dd0)
dblib.c:258:dblib_del_connection(0x100f8e430, 0x7f93f470dec0)
mem.c:615:tds_free_all_results()
util.c:156:Changed query state from IDLE to DEAD
dblib.c:305:dblib_release_tds_ctx(1)
dblib.c:5882:dbfreebuf(0x7f93f4717dd0)Process finished with exit code 0