Method: Mys3ql::Mysql#apply_bin_logs
- Defined in:
- lib/mys3ql/mysql.rb
#apply_bin_logs(files) ⇒ Object
files - array
65 66 67 68 69 70 71 72 |
# File 'lib/mys3ql/mysql.rb', line 65 def apply_bin_logs(files) return if files.empty? cmd = "#{@config.bin_path}mysqlbinlog --database=#{@config.database} #{files.join ' '}" cmd += " | #{@config.bin_path}mysql -u'#{@config.user}'" cmd += " -p'#{@config.password}'" if @config.password cmd += " -h #{@config.host}" if @config.host run cmd end |