Как найти строку во всех таблицах базы?
Я вывел список баз таким образом:
with open("output.log", "a") as outfile:
outfile.write("... Подключаюсь к БД."+"\n")
try:
mydb = mysql.connector.connect(
host="IP",
user="USER",
password="DB",
)
with open("output.log", "a") as outfile:
outfile.write("+ Успешное подключение к БД."+"\n")
except mysqldb.Error as e:
print(f"Error connecting to MYSQL Platform: {e}")
with open("output.log", "a") as outfile:
outfile.write(f"- Error connecting to MYSQL Platform: {e}\n")
sys.exit(1)
mycursor = mydb.cursor()
listdbs = []
querrydb = ("SHOW DATABASES")
mycursor.execute(querrydb)
for querrydb in mycursor:
#print(querrydb[0])
listdbs.append(querrydb[0])
with open("output.log", "a") as outfile:
outfile.write("+ Отображаю список БД."+"\n")
print("Что хотите найти: ")
choiceword = input()
with open("output.log", "a") as outfile:
outfile.write("+ Поиск слов: "+choiceword+"\n")
for db in listdbs:
print(db)
как мне в выбранной базе найти строку или число во всех таблицах через python? пусть они будут повторяться