WebFaction
Community site: login faq

I'm trying to connect to my production MySQL DB on my local machine.

I've followed the tunneling instructions on the docs but get this when I try to start the server:

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'username'@'localhost' (using password: YES)")

Note: I'm not including my real username in the string above for privacy reasons.

This is what my Django settings look like:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'db_name',                    
    'USER': 'db_name',                    
    'PASSWORD': 'db_name',                
    'HOST': '127.0.0.1',                 
    'PORT': '3306',                     
}

}

Any help?

asked 05 Dec '10, 22:57

aa56280
131714
accept rate: 0%

Hi,

When you say "local machine" are you meaning your computer at home or your server's local database server?

(05 Dec '10, 23:02) klynton

I mean my computer at home.

(05 Dec '10, 23:06) aa56280

In your example above, you're using 'db_name' as the password. You should be using your DB password as the password.

(06 Dec '10, 16:47) seanf

Hi,

Here's the answer for getting remote access to your database:

http://community.webfaction.com/questions/745/remote-access-mysql-server-on-webfaction?page=1#746

So that you can access it without a tunnel, then your Django settings should look like this:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'db_name',                    
    'USER': 'db_name',                    
    'PASSWORD': 'db_password',                
    'HOST': 'serverIPAddress',                 
    'PORT': '3306',                     
    }
}
permanent link

answered 05 Dec '10, 23:39

klynton
1.6k1210
accept rate: 41%

That does not work either

(06 Dec '10, 16:34) aa56280

As far as I can tell, you've not submitted a support ticket to let us know the name of your database so that we can enable remote access for it, as mentioned in the link in Klynton's reply. If we do that for you, then the settings above will work.

(06 Dec '10, 16:47) seanf

Ah, missed that requirement. Thanks.

(06 Dec '10, 16:56) aa56280
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909

question asked: 05 Dec '10, 22:57

question was seen: 10,401 times

last updated: 06 Dec '10, 16:56

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM