質問編集履歴
1
別のエラーが出たので質問内容をかえさせていただきます
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,6 +10,11 @@
|
|
10
10
|
実行すると3分ほど動かずその後下記のエラーが出てきます、これはデータベースを見つけられてないのでしょうか?
|
11
11
|
質問に慣れていなくて抜けている所があったらすみません。
|
12
12
|
|
13
|
+
追記(2/7)
|
14
|
+
can110様のアドバイスによりインスタンスを追加したところPython側で実行したときの待機時間は無くなったのですがすぐ別のエラーが出るようになってしまいましたエラー内容を見ても原因がわからず再度追記という形で質問させていただきます。
|
15
|
+
コードで抜けている所があったりSQL server側で設定などで必要なものなどがあれば教えてほしいです。
|
16
|
+
たびたびすみません
|
17
|
+
|
13
18
|
### 発生している問題・エラーメッセージ
|
14
19
|
|
15
20
|
```
|
@@ -28,7 +33,26 @@
|
|
28
33
|
File "src\pymssql.pyx", line 642, in pymssql.connect
|
29
34
|
pymssql.OperationalError: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (DESKTOP-93EGBUF:1433)\nNet-Lib error during Unknown error (10060)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (DESKTOP-93EGBUF:1433)\nNet-Lib error during Unknown error (10060)\n')
|
30
35
|
```
|
36
|
+
```
|
37
|
+
追記(2/7)
|
38
|
+
test.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
|
39
|
+
import pymssql
|
40
|
+
Traceback (most recent call last):
|
41
|
+
File "src\pymssql.pyx", line 636, in pymssql.connect
|
42
|
+
File "src\_mssql.pyx", line 1957, in _mssql.connect
|
43
|
+
File "src\_mssql.pyx", line 676, in _mssql.MSSQLConnection.__init__
|
44
|
+
File "src\_mssql.pyx", line 1683, in _mssql.maybe_raise_MSSQLDatabaseException
|
45
|
+
_mssql.MSSQLDatabaseException: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (localhost\MSSQLSERVER)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (localhost\MSSQLSERVER)\n')
|
31
46
|
|
47
|
+
During handling of the above exception, another exception occurred:
|
48
|
+
|
49
|
+
Traceback (most recent call last):
|
50
|
+
File "test.py", line 4, in <module>
|
51
|
+
cnxn = pymssql.connect('.\MSSQLSERVER', '***', '***', 'sanple_0206')
|
52
|
+
File "src\pymssql.pyx", line 642, in pymssql.connect
|
53
|
+
pymssql.OperationalError: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (localhost\MSSQLSERVER)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (localhost\MSSQLSERVER)\n')
|
54
|
+
```
|
55
|
+
|
32
56
|
### 該当のソースコード
|
33
57
|
|
34
58
|
```
|
@@ -43,6 +67,21 @@
|
|
43
67
|
cnxn.close()
|
44
68
|
```
|
45
69
|
|
70
|
+
```
|
71
|
+
追記(2/7)
|
72
|
+
# pymssql=2.1.4
|
73
|
+
# SQL Server=2017(14.0.1000.169)
|
74
|
+
# Python=3.7.4
|
75
|
+
|
76
|
+
import pymssql
|
77
|
+
conn = pymssql.connect(server='DESKTOP-93EGBUF\MSSQLSERVER', user='***', password='***', database='sanple_0206')
|
78
|
+
cursor = conn.cursor()
|
79
|
+
|
80
|
+
cursor.execute('INSERT INTO test0206 VALUES(40,41,42)')
|
81
|
+
row = cursor.fetchone()
|
82
|
+
|
83
|
+
conn.close()
|
84
|
+
```
|
46
85
|
### 試したこと
|
47
86
|
|
48
87
|
|