jueves, marzo 23, 2023
InicioSoftware EngineeringThe right way to Create a MySQL Desk in Python

The right way to Create a MySQL Desk in Python


If it’s good to create a desk in a MySQL database utilizing Python, then you are able to do the next.

The right way to Create a MySQL Desk in Python

import mysql.connector

mydb = mysql.connector.join(
  host = "localhost",
  consumer = "username",
  password = "YoUrPaSsWoRd",
  database = "your_database"
)

mycursor = mydb.cursor()

mycursor.execute("CREATE TABLE individuals (title VARCHAR(255), deal with VARCHAR(255))")

The right way to Verify if a MySQL Desk Exists in Python

import mysql.connector

mydb = mysql.connector.join(
  host = "localhost",
  consumer = "yourusername",
  password = "YoUrPaSsWoRd",
  database = "your_database"
)

mycursor = mydb.cursor()

mycursor.execute("SHOW TABLES")

for x in mycursor:
  print(x)
admin
adminhttps://shortsavepeli.xyz
Lover of movies and series. rather. lover to the cinema in generating. I hope you like my blog.
RELATED ARTICLES

DEJA UNA RESPUESTA

Por favor ingrese su comentario!
Por favor ingrese su nombre aquí

Most Popular

Recent Comments