P
P
Pavel2019-02-14 01:39:12
Python
Pavel, 2019-02-14 01:39:12

How to connect to my database via pythonanywhere site?

There is a bot written in python. I want him to take information from the database that is on the computer. Other people can connect to it and edit it, which means you can connect to it remotely. But through the bot that is on the pythonanywhere site, I can’t connect, although the same code in pycharm works without errors.
Here is the code

import pymssql
conn = pymssql.connect(server='Мой ip', user='admin', password='123', database='VKbot')
cursor = conn.cursor()
cursor.execute('SELECT login'
               ' FROM dbo.Authentication')
result = cursor.fetchall()
print(result)

pymssql.OperationalError
: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist ("My ip")\nNet-Lib error during Connection refused (111) \n')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dgk, 2019-05-04
@dgk

most likely not, they don't even allow all http traffic https://help.pythonanywhere.com/pages/403Forbidden...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question