首页 > 解决方案 > Heroku 在 cleardb 数据库中提供的用户访问被拒绝

问题描述

使用 ClearDB 在 Heroku 中提供的凭据,他能够创建一个数据库:

engine = create_engine('mysql://user:password@host.cleardb.com/heroku_02c821a76ca04c8')
df.to_sql('attributs', engine,if_exists='append')

但是当我阅读信息时,似乎缺少权利。我试过了:

ubu@DESKTOP-QL4RO3V:/mnt/c/Windows/system32$ mysql -u user -p'password' -h host.cleardb.com -D heroku_02c821a76ca04c8
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47008095
Server version: 5.6.50-log MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW TABLES;
+----------------------------------+
| Tables_in_heroku_02c821a76ca04c8 |
+----------------------------------+
| attributs                        |
+----------------------------------+
1 row in set (0.03 sec)

mysql> use attributs;
ERROR 1044 (42000): Access denied for user 'user'@'%' to database 'attributs'

所以我创建了第二个数据库来检查,似乎我可以创建数据库,但我无法获取它的信息;

mysql> create table test (username VARCHAR(255));
Query OK, 0 rows affected (0.05 sec)

mysql> use test;
ERROR 1044 (42000): Access denied for user 'bb9f0d500c90e4'@'%' to database 'test'
mysql> drop test;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test' at line 1
mysql> drop table test;

如何读取数据库中的信息?我需要root吗?还是做一个新用户?但我还没有见过这样的事情。

标签: herokuaccess-rightscleardb

解决方案


推荐阅读