Created
February 19, 2019 11:34
-
-
Save samadfcibd/8b558725c441ff6b29bf077a888714e8 to your computer and use it in GitHub Desktop.
This file contains 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
# Python needs a MySQL driver to access the MySQL database. | |
import mysql.connector | |
# Start by creating a connection to the database. | |
mydb = mysql.connector.connect( | |
host="192.168.152.221", | |
user="ocpl", | |
passwd="ocpl@321", | |
database="bida_oss" | |
) | |
# print(mydb) | |
mycursor = mydb.cursor() | |
mycursor.execute("SELECT user_email from users") | |
allUser = mycursor.fetchall() | |
for user in allUser: | |
print(user) | |
#oneUser = mycursor.fetchone() | |
#print(oneUser) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment