Search code examples
mysqlruby-on-railsherokucleardb

Upload mysql dump on heroku


I need to upload my local .sql dump into my heroku machine. I'm using MySQL db and the plugin ClearDB.

I have tried this command:

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

But I get this error as response:

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)

What should I do now? Thank you!

UPDATE: this is my heroku config output:

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

UPDATE 2.0:

I noticed that the host was wrong so I correct it:

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

But I still get errors:

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)

Solution

  • can you try this.

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

    I have just added --skip-ssl to it.

    update:

    I have noticed that now you are using "us-cdbr-iron-east-03.cleardb.com" but your actual host is "us-cdbr-iron-east-03.cleardb.net" can you please try by replacing .com by .net.