python3.11-PyMySQL/tests/smoke_test.py
Honza Horak fa1614bd41 Replace whole repo with latest content from branch rhel-8.8.0
Content corresponds with RHEL dist-git commit 38d89b1
2023-05-15 16:41:36 +02:00

13 lines
328 B
Python

#!/usr/bin/python3
# Modified from
# https://github.com/PyMySQL/PyMySQL/blob/v1.0.2/example.py
import pymysql
connection = pymysql.connect(unix_socket="/var/lib/mysql/mysql.sock", db="mysql")
cursor = connection.cursor()
cursor.execute("SELECT Host,User FROM user")
print(cursor.description)
cursor.close()
connection.close()