lib/flydata/compatibility_check.rb in flydata-0.2.29 vs lib/flydata/compatibility_check.rb in flydata-0.2.30

- old
+ new

@@ -1,6 +1,8 @@ +require 'mysql2' require 'flydata/command_logger' +require 'flydata/util/mysql_util' module Flydata class CompatibilityCheck include CommandLoggable @@ -116,10 +118,10 @@ end raise MysqlCompatibilityError, "The user '#{@db_opts[:username]}' does not have the correct permissions to run FlyData Sync\n * These privileges are missing: #{missing_priv.join(", ")}" end def check_mysql_protocol_tcp_compat - query = "MYSQL_PWD=\"#{@db_opts[:password]}\" mysql -u #{@db_opts[:username]} -h #{@db_opts[:host]} -P #{@db_opts[:port]} #{@db_opts[:database]} -e \"SHOW GRANTS;\" --protocol=tcp" + query = Util::MysqlUtil.generate_mysql_show_grants_cmd(@db_opts) Open3.popen3(query) do |stdin, stdout, stderr| stdin.close while !stderr.eof? lines = []