This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0%(1)0% found this document useful (1 vote)
126 views
Interface Python With MySQL
This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
d="delete from emp where id=555" cur=mycon.cursor( ) cur.execute(d) mycon.commit( ) print("Data Deleted")
BY: FARAH ARIF 1
7. Update data in MySQL Table: u="update emp set Salary=20000 where city='Gonda'" cur=mycon.cursor( ) cur.execute(u) mycon.commit( ) print("Updation Done")
OR
u1="update emp set Salary=25000 where name='Anil Soni'"
Generative Deep Learning: Teaching Machines to Paint, Write, Compose, and Play, 2nd Edition (Seventh Early Release) David Foster - The latest ebook edition with all chapters is now available
Computational Science And Its Applications Iccsa 2013 13th International Conference Ho Chi Minh City Vietnam June 2427 2013 Proceedings Part Iii 1st Edition Petr Sosnin Auth instant download