You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To install mysql-connector you need to install this via pip3
pip3 install mysql-connector-python
To create a new table use the traditional mysql way.
createtablertables(name varchar(20), surname varchar(20), age int,email varchar(20))
Python File for Databases
#!/usr/bin/python3importmysql.connectorasmysql# RDS infouser="root"pass="Redhat123"db="retro"host="mysqldbserver.cqypbbo9r82r.us-east-1.rds.amazonaws.com"# Now Connecting with Databaseconnection=mysql.connect(user=user,password=pass,database=db,host=host)
# Now Generating a sql lang cursorcur=connection.cursor()
# Now we can write SQL Querydata=cur.execute("Select * from rtables")
print(data)