Can't connect to MySQL server during migrate


(Renis) #1

Trying to migrate from vBulletin, having the same problem with MySQL …

Can’t connect to local MySQL server

$ RAILS_ENV=production ruby vbulletin.rb
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
/home/discourse/.gem/ruby/2.0.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql2::Error)
        from /home/discourse/.gem/ruby/2.0.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `initialize'
        from vbulletin.rb:21:in `new'
        from vbulletin.rb:21:in `initialize'
        from vbulletin.rb:484:in `new'
        from vbulletin.rb:484:in `<main>'

how do I verify if the requirements for migration are installed…

thank you!

# gem install mysql2
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.18
1 gem installed

(Renis) #2

any suggestions?

Thank you!


(Jens Maier) #3

You need to edit vbulletin.rb and enter your old server’s database connection settings. Available options for Mysql2::Client.new can be found here.

If the old database server is localhost or otherwise not accessible over the Internet, you will have to connect through an SSH tunnel or, in the worst case, temporarily install a MySQL server inside Discourse’s docker container and import a dump of vBulletin’s database.


(Renis) #4

MySQL is installed on the same server but outside the docker! I’m going to install inside!

Thank you!


(Renis) #5

@elberet thanks for your help again :smile:

It worked!