Hello. I tried to connect to my tests1 db via neo4j and HF accounts using py2neo but when I tried to do this I got the error that says I'm not able to connect to db. Examples below.
from py2neo import Graph
class BD_interact():
def __init__(self, protocol, ip_adress, port, bd_name, auth_name, auth_pass):
self.protocol = protocol
self.ip_adress = ip_adress
self.port = port
self.con_address = f'''{self.protocol}://{self.ip_adress}:{self.port}'''
# print(self.con_address)
self.bd_name = bd_name
self.auth_name = auth_name
self.auth_pass = auth_pass
# self.BD_connect()
def BD_connect(self):
self.graph = Graph(self.con_address, auth = (self.auth_name, self.auth_pass), name = self.bd_name)
self.con_status = True
print('[ERROR] Connection wasn\'t established! Try to use another port.' if not self.con_status else '[INFO] Connection established!')
return(self.con_status)
def BD_execute(self, query):
self.response = list(self.graph.run(query).to_table())[0]
return(self.response)
def BD_conncetion_check(self):
return()
bd_window = BD_interact('bolt', 'localhost', 11003, 'tests1', 'HF', 12345678)
bd_window.BD_connect()
What can I do for fix authorization error? I have no idea.