0

I used sqlalchemy to connect to the oracle server from python. (cx_oracle installation and oracle instant client setup are completed.)

The code I used is as follows: (I used the ip address instead of the hostname. The ip address is a sample value.)

engine = create_engine('oracle://scott:[email protected]:1521/sidname')
q = engine.execute(test_query)
q.fetchone()

But I got the error like below.

sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-24454: client host name is not set

I didn't use hostname, but I don't know why this error occurred. Shouldn't I use the ip address?

Is there a solution?

1 Answer 1

1

That error is about the configuration of the machine you are running SQLAlchemy on, not the syntax you are using. Using an IP address is OK.

Typically Linux users update /etc/hosts and add a hostname for the loopback address. If you update your question with system information, we can help more.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.