访问被拒绝创建初始数据库-如何授予正确的访问权限? [英] Access denied creating initial database- how do I grant the right access?
问题描述
我正在使用mysql在heroku上创建一个新项目(他们有一个名为JawsDB的插件,它为我提供了mysql主机,用户名和密码). (更新:我也尝试过使用他们的其他mysql插件,ClearDB,并且我遇到了完全相同的问题)
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]
问题:创建数据库nptest
时,我得到:
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]';
但这给了我:
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?
推荐答案
为进一步澄清Diane的答案,可以通过mysql客户端登录JawsDB并运行show databases
来找到神秘的数据库名称,或者它是运行heroku config
可以找到的JAWSDB_URL.
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
.
这篇关于访问被拒绝创建初始数据库-如何授予正确的访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!