anlek/mongify

SELECT command denied to root

Closed this issue · 2 comments

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 FROM registrados(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:in query'
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:in block 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:in log'
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:in execute'
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:in columns'
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:in block 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:in load'
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:in execute!'
from /Library/Ruby/Gems/2.0.0/gems/mongify-1.3.1/bin/mongify:15:in <top (required)>' from /usr/local/bin/mongify:23:in load'
from /usr/local/bin/mongify:23:in `

'

Things to consider:

  • I'm passing "root" asu user in the database.config file
  • User root has all privileges for the database, and these are not Table specific privileges

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?

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

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

Take care,
Andrew