Open santy8151 opened 1 year ago
!pip install mysql-connector-python import mysql.connector import pandas as pd
config = { 'user': 'tu_usuario', 'password': 'tu_contraseña', 'host': 'tu_host', 'database': 'tu_base_de_datos' }
conn = mysql.connector.connect(**config)
cursor = conn.cursor()
query = "SELECT * FROM estudiantes" cursor.execute(query)
rows = cursor.fetchall() columns = [desc[0] for desc in cursor.description]
df = pd.DataFrame(rows, columns=columns)
df.to_csv('/content/estudiantes.csv', index=False)
cursor.close() conn.close() from google.colab import files
files.download('/content/estudiantes.csv')
!pip install mysql-connector-python
import mysql.connector import pandas as pd
config = { 'user': 'tu_usuario', 'password': 'tu_contraseña', 'host': 'tu_host', 'database': 'tu_base_de_datos' }
conn = mysql.connector.connect(**config)
cursor = conn.cursor()
query = "SELECT * FROM estudiantes" cursor.execute(query)
rows = cursor.fetchall() columns = [desc[0] for desc in cursor.description]
df = pd.DataFrame(rows, columns=columns)
df.to_csv('/content/estudiantes.csv', index=False)
cursor.close() conn.close()
from google.colab import files
files.download('/content/estudiantes.csv')
let Origen = Sql.Database("nombre-del-servidor", "nombre-de-la-base-de-datos"), Fuente = Origen{[Schema="dbo",Item="Ventas"]}[Data] in Fuente