Jump to content

Recommended Posts

Posted

Username: bmeyer, Server: Johnny, Main domain: earlyedresearch.org

 

Dear Sir or Madam,

Yesterday we were fortunate enough to obtain space on one of your servers.=

=C2=A0 I have since read the Wiki on setting up a MySQL database and it was=

quite helpful.=C2=A0 Thank you.

-

The Wiki contained information about accessing the database with PHP.=C2=A0=

My back end processing is Python and Flask.=C2=A0 Is there a way to connec=

t to MySQL via those processes?

-

Thank you for any guidance you may be able to provide.

Best,

 

Bruce Meyer

Early Education Research Foundation.

Posted

Yes, try something like this:

 

import mysql.connector

 

mydb = mysql.connector.connect(

host="localhost",

user="bmeyer_user",

password="yourpassword",

database="bmeyer_db"

)

 

mycursor = mydb.cursor()

 

mycursor.execute("SELECT * FROM example")

 

myresult = mycursor.fetchall()

 

for x in myresult:

print(x)

Guest
This topic is now closed to further replies.
×
×
  • Create New...