mysql error 11001 in mysqldb

when trying to run a query in mysqldb from python I was getting the error 11001.
the best option would be run the query as below:
conn = ms.connect(host=”localhost”,port=3307, user = “root”, passwd = “”, db = “xxx”)
This error would be seen because I changed the port when I was installing MySql. So when mysql runs it checks for the default port in most installations 3306 and you get the error such that a particular localhost doesn’t exists and among others.

Leave a Reply

Your email address will not be published. Required fields are marked *