Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector;
- from mysql.connector import errorcode;
- user="root";
- password="toor";
- host="localhost";
- database="pydb";
- try:
- print("Hello")
- conn=mysql.connector.connect('root','toor','localhost:8000','pydb');//have also tried localhost only still same error
- print("Hello2");
- mycursor=conn.cursor();
- print("Hello3");
- mycursor.execute("show tables;");
- print("Hello4");
- print(mycursor.fetchall());
- print("Hello5");
- conn.close()
- except mysql.connector.Error as err:
- print("Something went wrong: {}".format(err))
- conn=mysql.connector.connect('root','toor','localhost:8000','pydb');
- return MySQLConnection(*args, **kwargs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement