I installed a fresh MySQL instance and tried connecting to the instance via MySQL Workbench (using the IP address, default port, username / password). The connection was successful. So these values are correct.
I then created a new db schema "newDB" and granted all privileges to the same user for newDB.
Next, I'm using the following ruby code to connect to this MySQL instance.
require 'fileutils'
require 'logger'
require 'sequel'
require 'mysql2'
DATABASE_URL = 'mysql2://The.IP.Address:3306'
DB_OPTIONS = { encoding: 'utf8', sql_log_level: :debug, adapter: "mysql2", database: "newDB", password: 'password123', username: 'someUser', host:'The.IP.Address', port:'3306' }
database_connection = Sequel.connect(DATABASE_URL, DB_OPTIONS.merge(logger: database_logger))
However, this connection fails. Here is the stacktrace:
13: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/core.rb:124:in `connect'
12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/database/connecting.rb:57:in `connect'
11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/database/connecting.rb:57:in `new'
10: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/database/misc.rb:169:in `initialize'
9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/database/connecting.rb:278:in `test_connection'
8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/database/connecting.rb:269:in `synchronize'
7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/connection_pool/threaded.rb:139:in `acquire'
5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/connection_pool/threaded.rb:209:in `assign_connection'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/connection_pool.rb:122:in `make_new'
3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/adapters/mysql2.rb:43:in `connect'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sequel-5.44.0/lib/sequel/adapters/mysql2.rb:43:in `new'
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0.5.3-x64-mingw32/lib/mysql2/client.rb:90:in `initialize'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0.5.3-x64-mingw32/lib/mysql2/client.rb:90:in `connect': Mysql2::Erro (Sequel::DatabaseConnectionError)sha2_password' cannot be loaded: The specified module could not be found.
How do I fix this error? I seem to have provided the correct values for hostname, username etc.