python - Error to view my data from database -


i'm new in python , mysql. attempt view first row of data database. code:

import mysqldb  db = mysqldb.connect(host="localhost", # host, localhost                      user="root", # username                      passwd="", # passwords                      db="58c_t2d_10") # name of database  # must create cursor object.  # let execute queries need cur = db.cursor()   # use sql cur.execute("select * 58c_10")  # print first cell of rows row in cur.fetchall() :     print row[0] 

and got error:

operationalerror: (1044, "access denied user ''@'localhost'                            database '58c_t2d_10'") 

i've tried sign in root:

programmingerror: (1064, "you have error in sql syntax; check manual                            corresponds mysql server version                            right syntax use near '58c_10' @ line 1") 

cur.execute("select * 58c_10")   u have missed 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -