Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import psycopg2
  2. try:
  3. conn = psycopg2.connect("dbname='mb_sed_class' user='postgres' host='localhost' password='Daniel'")
  4. except:
  5. print "I am unable to connect to the database"
  6.  
  7. print ("I connected to the database")
  8. cur = conn.cursor()
  9. cur.execute("select relname from pg_class where relkind='r' and relname !~ '^(pg_|sql_)';")
  10. print cur.fetchall()
  11.  
  12. psql -d mb_sed_clsss -U postgres
  13.  
  14. FATAL: pssword Authentication failed for user "postgres"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement