anlek / mongify

Mongify allows you to map your data from a sql database and into a mongodb document database.
http://github.com/anlek/mongify
MIT License
317 stars 82 forks source link

SELECT command denied to root #141

Closed romafederico closed 7 years ago

romafederico commented 7 years ago

Hello there!

I'm running mongify on macOS and when I try to translate a mysql database I get the following error:

/Library/Ruby/Gems/2.0.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:in _query': Mysql2::Error: SELECT command denied to user ''@'69.163.128.0/255.255.128.0' for column 'origen' in table 'nmw_usuarios_web': SHOW FULL FIELDS FROMregistrados(ActiveRecord::StatementInvalid) from /Library/Ruby/Gems/2.0.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:inblock in query' from /Library/Ruby/Gems/2.0.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:in handle_interrupt' from /Library/Ruby/Gems/2.0.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:inquery' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in block in execute' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:inblock in log' from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in instrument' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:inlog' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in execute' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:225:inexecute' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:316:in execute_and_free' from /Library/Ruby/Gems/2.0.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:463:incolumns' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/database/sql_connection.rb:75:in columns_for' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/translation.rb:73:inblock in load' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/translation.rb:71:in each' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/translation.rb:71:inload' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/cli/command/worker.rb:66:in execute' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/lib/mongify/cli/application.rb:28:inexecute!' from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/bin/mongify:15:in <top (required)>' from /usr/local/bin/mongify:23:inload' from /usr/local/bin/mongify:23:in `

'

Things to consider:

The weird part for me is SELECT command denied to user ''@'69.163.128.0/255.255.128.0' for column 'origen' in table 'nmw_usuarios_web'

Is mongify not using root as user?

romafederico commented 7 years ago

I found the error.

I was trying to translate a view without the mysql user from the production server. Once I deleted the views it worked.

anlek commented 7 years ago

Glad to hear! Hopefully, the rest of the process was painless!

Take care, Andrew