I\'m trying to connect to MySQL on localhost using PyMySQL:
import pymysql conn = pymysql.connect(db=\'base\', user=\'
You need to add the port to the connection as well. Try this and it works fine.
pymysql(Module Name).connect(host="localhost", user="root", passwd="root", port=8889, db="db_name")