5

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?

user3918985
  • 4,278
  • 9
  • 42
  • 63
  • 1
    possible duplicate of [Access denied for user on MySQL database](http://stackoverflow.com/questions/24593262/access-denied-for-user-on-mysql-database) – Bud Damyanov Aug 22 '14 at 12:26

1 Answers1

13

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

Naktibalda
  • 13,705
  • 5
  • 35
  • 51
  • In the case of importing: This also means that if your `.sql` contains the instruction to `CREATE DATABASE` and `USE`, then you might have to remove those lines. – Abhinay Nov 12 '20 at 04:51