Diane Kaplan
Diane Kaplan

Reputation: 1708

Access denied creating initial database- how do I grant the right access?

I'm making a new project on heroku, using mysql (they have an addon called JawsDB, which gives me a mysql host, username, password). (Update: I've also tried using their other mysql addon, ClearDB, and I have the exact same issue)

I can connect to the database like so (and I can 'show databases' to see what's there):

mysql -h izm96dhhnwr2ieg0.cbetxkdyhwsb.us-east-1.rds.amazonaws.com -u knu81lzn5m79u3rx -p[given_password] 

Problem: When I do create database nptest, I get:

Access denied for user 'knu81lzn5m79u3rx'@%' to database 'nptest'

I've tried granting all privileges, like this:

grant all privileges on *.* to 'knu81lzn5m79u3rx'@'%' identified by '[given_password]';

but that gives me:

Access denied for user 'knu81lzn5m79u3rx'@'%' (using password: YES)

I also tried create user to make a fresh one, but of course then it's "Access denied" because I don't have create user privileges either.

What's the correct way to grant access to this user?

Upvotes: 4

Views: 4222

Answers (3)

khoubaib Boughalmi
khoubaib Boughalmi

Reputation: 1

i think if you use it in production mode it will solve the probl

Upvotes: 0

Tomás Metcalfe
Tomás Metcalfe

Reputation: 372

To further clarify on Diane's answer, the cryptic database name can be found by logging into JawsDB via a mysql client and runningshow databases or it's the last parameter of the JAWSDB_URL that can be found running heroku config.

Upvotes: 0

Diane Kaplan
Diane Kaplan

Reputation: 1708

Ah! The answer was that the preliminary plan on jawsDB gives you one specific database (that has a cryptic name) on a shared server with other people, so you don't have permissions to make a new one. It wasn't clear in the instructions, so now I'm humming away with good old database "tbkrv66g085ulngi" :)

Upvotes: 5

Related Questions