D
D
denislysenko2021-10-14 11:03:22
MySQL
denislysenko, 2021-10-14 11:03:22

How to execute sql script which is stored in .sql file in python file using pymysql.connect library?

There are files with sql extension.
How to execute these sql queries from python program using cursor.execute()
?
That is, how to pass the sql query, which is stored in the sql file, to the execute method, so that everything is executed without an error, even if there are several sql queries in a row in one sql script

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ipatiev, 2021-10-14
@Fockker

4. After posting a question, the user is prohibited from:
4.1. Duplication of a question that has already been posted on the pages of the Service. Including if the question was deleted by the moderator, or the question was not answered (that is, duplication of the question in order to re-draw attention to it is strictly prohibited).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question