By blastup
Hello, I’m trying to connect to one of our managed databases from the rails application with no luck after trying almost every option out there.
I can successfully connect using the flag string: mysql -u doadmin -pPASSWORD -h db-XXXXXXXX-prod-do-user-xxxxx-0.db.ondigitalocean.com -P 25060 -D defaultdb
I have tried both doadmin user as well as other users or datbases. I have tried connecting via the database.yml file with either db url or db details. I have also tried with and without SSL in my database.yml file.
All options give me the same error:
01 rake aborted!
01 Mysql2::Error::ConnectionError: SSL connection error: unknown error number
01 /home/ordering/public_html/reactive_ordering/production/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect'
01 /home/ordering/public_html/reactive_ordering/production/shared/bundle/ruby/2.5.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize'
Here is an example of my database.yml file
default: &default
adapter: mysql2
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 20 } %>
timeout: 1000
encoding: utf8
sslmode: require
sslca: <%= Rails.root.join("config/MY-DB.crt") %>
production:
<<: *default
# With connection string
# url: <%= ENV["DATABASE_URL"] %>
database: <%= ENV["DATABASE_NAME"] %>
username: <%= ENV["DATABASE_USERNAME"] %>
password: <%= ENV["DATABASE_PASSWORD"] %>
host: <%= ENV["DATABASE_HOST"] %>
port: 25060
Any help would be much appreciated. Thank you
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi! I am having exactly the same issue. I’ve spent a few hours already and I haven’t managed to use DO MySQL yet. Have you found a solution in the meantime? Thanks!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.