[SOLVED] Cant connect to server in jupyter notebooks

Hello,

I am having trouble connecting to my moralis server through jupyter notebooks. I followed the youtube tutorial identically and am getting an error as follows:

ServerSelectionTimeoutError: 165.227.201.98:56728: [Errno 61] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 62fdb801378bda326925531d, topology_type: Single, servers: [<ServerDescription (β€˜165.227.201.98’, 56728) server_type: Unknown, rtt: None, error=AutoReconnect(β€˜165.227.201.98:56728: [Errno 61] Connection refused’)>]>

any help would be greatly appreciated. could it be that my database is too big, and thats why its taking too long to connect? its only 7.7k lines, maybe thats not it.

TIA

7k is not big. Does it work to connect in onerous ways? Did you add your public IP to whitelist?

it does not connect to the server with this :

import pymongo
import pandas as pd

host = β€˜165.227.201.98’
port = 56728

con = pymongo.MongoClient(host, port)
unipairs = con[β€˜parse’][β€˜pools’]

data = unipairs.find()

df = pd.DataFrame.from_dict(list(data))
df

Do you get any error? As mentioned did you whitelist your public IP address in your server settings for database access?

this is the error i get, and yes i whitelisted my own ip address. Just checked, and it is the correct one
looks like the error is that its taking too long to connect

it worked!! after i removed and readded my IP. thanks a bunch

1 Like