- MySQL for Python
- Albert Lukaszewski, PhD
- 76字
- 2021-04-13 17:12:27
In MySQL for Python, all database objects are discrete. All you need do is to connect with each under a different name. Consider the following:
mydb1 = MySQLdb.connect(host="localhost", user="skipper", passwd="mysecret", db="fish") mydb2 = MySQLdb.connect(host="localhost", user="skipper", passwd="mysecret", db="fruit") cursor1 = mydb1.cursor() cursor2 = mydb2.cursor()
The objects then function like any other variable or object. By calling their methods and attributes separately, you can interact with either or even copy from one to the other.
推薦閱讀
- Photoshop CS6完全自學案例教程(微課版)
- 中文版 Photoshop CC 從入門到精通
- 零基礎學數碼攝影后期
- 新編AutoCAD 2016從入門到精通
- 中文版After Effects 2022基礎教程
- VR策劃與編導
- Photoshop CC 2019 平面設計實例教程
- Photoshop+CorelDRAW 字體設計與創意:草圖/實現/包裝(微課版)
- Photoshop CC入門與提高
- 零基礎攝影后期修圖 Photoshop照片處理輕松入門
- 中文版Photoshop CS5平面設計實用教程(第2版)
- 中文版InDesign CC平面排版設計從入門到精通
- Oracle Web Services Manager
- 這樣學Excel數據處理與分析更高效(視頻版)
- CorelDRAW 2018平面設計基礎教程(第3版)