MySQL: Access denied for user to database

喜欢而已 提交于 2019-12-10 20:35:44

问题


I'm trying to create a database on my remote sql server - clearDB - on Heroku. I connected with this:

mysql --host='<<cleardbhostname>>' --user='<<lsdj234>> --password

My username and password are obtained from the result from running heroku config. When I tried to run

CREATE DATABASE mydb;

I got this:

ERROR 1044 (42000): Access denied for user '<<lsdj234>>'@'%' to database 'mydb'

When I ran SHOW GRANTS for current_user I got:

GRANT USAGE ON *.* TO '<<lsdj234>>'@'%' IDENTIFIED BY PASSWORD '*asfe4545235' WITH     MAX_QUERIES_PER_HOUR 3600 MAX_USER_CONNECTIONS 10 |
| GRANT ALL PRIVILEGES ON `heroku_ljl4455lkj`.* TO '<<lsdj234>>'@'%' 

What is happening? How do I resolve this?


回答1:


The only database that your user can access (and even create) is heroku_ljl4455lkj
It can't create any other databases.



来源:https://stackoverflow.com/questions/25446937/mysql-access-denied-for-user-to-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!