MySQL Forums
Forum List  »  Connector/Python

No password assigned during MySQL install
Posted by: Bill Orton
Date: May 19, 2014 06:29AM

Hello, I just installed MYSQL and the Python MySQL connector on my Mac OSX Pro. The installations appeared to have proceeded smoothly. During the install I was not prompted to enter a MySQL password. How do I determine what my password is? Is there a default password? I am attempting to use the Python mysql connector but am receiving an error message and I am wondering if it is because I do not know what password to enter. Here is my code and associated error message.

>>> import mysql.connector
>> conn = mysql.connector.connect(host='localhost', user='root', passwd='python')

Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
conn = mysql.connector.connect(host='localhost', user='root', passwd='python')
File "/Library/Python/2.7/site-packages/mysql/connector/", line 98, in connect
return MySQLConnection(*args, **kwargs)
File "/Library/Python/2.7/site-packages/mysql/connector/", line 118, in __init__
File "/Library/Python/2.7/site-packages/mysql/connector/", line 382, in connect
File "/Library/Python/2.7/site-packages/mysql/connector/", line 345, in _open_connection
File "/Library/Python/2.7/site-packages/mysql/connector/", line 386, in open_connection
errno=2003, values=(self.get_address(), _strioerror(err)))
InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (61 Connection refused)

I am using the Programming Python text by Mark Lutz as my guide / text and the code I am copying used python as the password. If anybody could help me understand how to make the MySQL connection work properly I would appreciate it. I am just guessing that my problem is an incorrect password.

Options: ReplyQuote

Written By
No password assigned during MySQL install
May 19, 2014 06:29AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.