(toc) #title=(Table of Contact)
Database
* The Python standard for database interfaces is the Python DB-API. Most Python database interfaces adhere to this standard.
* You can choose any database for your application.
* Gadfly, mSQL, MySQL, PostgreSQL, Microsoft SQL Server 2000 Informix, Interbase, Oracle, Sybase
* First install pymysql library using following command in cmd. Pip install pymysql
* Install SQLYOG software for database work.
Link Download:
Step for working with Database
* Create Database in sqlyog.
* Importing the API module. import pymysql
* Acquiring a connection with the database.
Conn = pymysql.connect(Host = " ", Database = " ", User = " ", Password = " ", Port = 3306)
* Issuing sql statements.
cursor = conn.cursor()
query = " "
cursor.execute(query)
* Closing the connection.
conn.commit()
conn.close()
Program 1) #Creating connection with Database
def CreateConn():
return pymysql.connect(host = "localhost", database = "hrsikh", user = "root", password = " ", Port = 3306)