Cannot connect to DreamHost mysql database "access denied for user..."

software development
mysql

#1

Hi, I am trying to connect my python/django project to a DB created on my DreamHost account.

After hours of trying to fix the problem of getting pip to install mysqlclient without errors, I’ve come accross a new roadblock.

A little about my project:
virtual environment with python 3.4.3
django 1.10.1
mysqlclient 1.3.9
setuptools 12.0.5

I went and replaced my database information in the settings.py file with:

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘RichmondDiamondsDB’,
‘USER’: ‘rd_srydzewski’,
‘PASSWORD’: ‘hidden’,
‘HOST’: ‘mysql.richmonddiamonds.ca’,
}
}

and so it’s late, and getting ready to hit the sack, but would appreciate guidance and pointers as to what I am doing wrong.

I created the database info as described above (excluding a ‘PORT’ property since its I’m not testing it against a local DB server), and yet I get this error message in the prompt window.

django.db.utils.OperationalError: (1045, “Access denied for user ‘rd_srydzewski’@135-23-171-91.cpe.pppoe.ca’ (using password: YES)”)

before this I was testing my project against sqlite3 within my project folder, now I want to host the db on dreamhost.

Please-Help!


#2

Well… dumdum(self)

for starters, you might want to go to “GOODIES”>>“MySQL Databases” scroll down to ‘Database(s) on this server’, click on rd_srydzewski and let it take you to the user in question permissions. In the next page scroll down where you find ‘Allowable Hosts’, there you will find “Your current computer is: ###.###.###.###”, enter this IP number on a new line in the text box to the right of it and click ‘Modify rd_srydzewski now!’

next, in your projects settings.py file, change your:

‘NAME’: ‘RichmondDiamondsDB’,

to:

‘NAME’: ‘richmonddiamondsdb’,

now give it a try.
[hr]
Thanks, dingus(self)

It might not have been apparent, but makes sense to have that extra layer of security… but what strikes me is that, when creating the new database, the form warns you that you cannot use capitals in user name, but they allow you to enter capitals in database name… only to automatically have it lowercase anyways when the DB is generated.

I mean… come on!!
[hr]
Yeah, I know right?

Maybe someone should let these guys at DreamHost in on the interesting oversight or trolling warning message system.

Oh well… have a good one ijjit(self)
[hr]
Thanks, duffis(self)