Hello there. Today I tried to move a site using Flarum to Discourse.
I have successfully installed the Discourse development environment on my Win 10 computer via WSL2.
-
I installed Mysql 5.7 version in development environment.
-
I have successfully imported the database into the development environment.
-
I installed mysql2 with the command
gem install mysql2
-
I added the following to the end of the Gemfile with the
sudo nano Gemfile
command.
gem 'mysql2'
FLARUM_HOST ||= ENV['FLARUM_HOST'] || "localhost"
FLARUM_DB ||= ENV['FLARUM_DB'] || "flarum"
BATCH_SIZE ||= 1000
FLARUM_USER ||= ENV['FLARUM_USER'] || "mekici"
FLARUM_PW ||= ENV['FLARUM_PW'] || "mypass"
now bundle install
followed by the following command:
bundle exec ruby script/import_scripts/flarum_import.rb
and the error I get:
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
Traceback (most recent call last):
5: from script/import_scripts/flarum_import.rb:162:in `<main>'
4: from script/import_scripts/flarum_import.rb:162:in `new'
3: from script/import_scripts/flarum_import.rb:20:in `initialize'
2: from script/import_scripts/flarum_import.rb:20:in `new'
1: from /home/mekici/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize'
/home/mekici/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect': Unknown MySQL server host 'db_host' (0) (Mysql2::Error::ConnectionError)
What am I doing wrong. It’s strange that it gives the MySQL connection error because the MySQL server is active and running. Am I doing something wrong?