1

我需要将我的本地 .sql 转储上传到我的 heroku 机器中。我正在使用 MySQL db 和插件 ClearDB。

我试过这个命令:

 mysql --host=us-cdbr-east.cleardb.com --user=MY_USER --password=MY_PASSWORD --reconnect heroku_xxxxxxxxxxxx < test.sql

但我收到此错误作为响应:

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2026 (HY000): SSL connection error: error:00000001:lib(0):func(0):reason(1)

我现在该怎么办?谢谢!

更新:这是我的 heroku 配置输出:

CLEARDB_DATABASE_URL:     mysql://xxxxxxx:xxxxxxx@us-cdbr-iron-east-03.cleardb.net/heroku_xxxxxxxxxxx?reconnect=true
DATABASE_URL:             mysql2://xxxxxxxxx:xxxxxxxxx@us-cdbr-iron-east-03.cleardb.net/heroku_xxxxxxxxxxx?reconnect=true
LANG:                     en_US.UTF-8
MAX_THREADS:              1
MIN_THREADS:              1
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE:          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

更新 2.0:

发现楼主写错了,改正一下:

mysql --host=us-cdbr-iron-east-03.cleardb.com --user=xxxxxx --password=xxxxxx --skip-ssl --reconnect heroku_xxxxxx < test.sql

但我仍然收到错误:

mysql: [Warning] Using a password on the command line interface can be insecure.
WARNING: --ssl is deprecated and will be removed in a future version. Use --ssl-mode instead.
ERROR 2003 (HY000): Can't connect to MySQL server on 'us-cdbr-iron-east-03.cleardb.com' (61)
4

1 回答 1

1

你能试试这个吗?

mysql --host=us-cdbr-east.cleardb.com --user=MY_USER --password=MY_PASSWORD --skip-ssl --reconnect heroku_xxxxxxxxxxxx < test.sql

我刚刚添加了 --skip-ssl 。

更新:

我注意到现在您使用的是“us-cdbr-iron-east-03.cleardb.com”,但您的实际主机是“us-cdbr-iron-east-03.cleardb.net”,请您尝试替换。 com 由 .net 提供。

于 2016-07-14T09:52:06.683 回答