Well, I did a litle search: first_site second_site So by the question I can only guess that you are using mysql so with python? If so, you can do it with pandas module
import sqlite3
# Connect to the database
conn = sqlite3.connect('example.db')
query = "SELECT * FROM users"
db = pd.read_sql_query(query, conn)
# This is the line of code you will be using to connect to the database
db.to_excel('users_data.xlsx', index=False)
conn.close()
# litle message at the end
print("Data exported successfully!")