1. Install the database DRIVER:
The MySQL driver is mysqldb [http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/]. The driver of Microsoft SQL is pymssql. You can directly go to the pypi website.
For more information about installing mysqldb in windows, see the following link:
Bytes
2. Test
Import mysqldb as MySQL def test_mysql (): conn = MySQL. connect (host = '10. 255.254.208 ', user = 'writeuser', passwd = 'Password', DB = 'mydb') cur = Conn. cursor () SQL = 'select product_id, is_product_product from products_core where is_0000_product = 1 and product_id> 10000 limit; 'cur.exe cute (SQL) print cur. fetchall () cur. close () Conn. close () Import pymssql def test_mssql (): conn = pymssql. connect (host = "10.20.254.207", user = "writeuser", password = "password", database = "account") cur = Conn. cursor () SQL = 'select top (10) money_id, cust_id from my_money'cur.exe cute (SQL) print cur. fetchall () cur. close () Conn. close if _ name _ = "_ main _": test_mysql () test_mssql ()