Databases Communications

  (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:

MySQL Community Downloads

SQLyog 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)
Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!