Created
March 16, 2020 09:25
-
-
Save askcompany-kr/a86d8ae6b573973d0d810b08924ea93b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| host = '...' | |
| user = '…' | |
| name = '…' | |
| password = '…' | |
| import MySQLdb | |
| db = MySQLdb.connect(host, user, password, name) | |
| cursor = db.cursor() | |
| try: | |
| cursor.execute('SELECT VERSION()') | |
| info = cursor.fetchone()[0] | |
| print(repr(info)) | |
| finally: | |
| cursor.close() | |
| db.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment