Class: Dumpman::Adapters::Mysql
- Inherits:
-
Base
- Object
- Base
- Dumpman::Adapters::Mysql
show all
- Defined in:
- lib/dumpman/adapters/mysql.rb
Instance Method Summary
collapse
Methods inherited from Base
create_cmd, drop_cmd, dump_cmd, restore_cmd
Instance Method Details
#create_cmd ⇒ Object
16
17
18
|
# File 'lib/dumpman/adapters/mysql.rb', line 16
def create_cmd
"MYSQL_PWD='#{password}' mysql -u #{username} -h #{host} -e 'create database #{database}'"
end
|
#drop_cmd ⇒ Object
12
13
14
|
# File 'lib/dumpman/adapters/mysql.rb', line 12
def drop_cmd
"MYSQL_PWD='#{password}' mysql -u #{username} -h #{host} -e 'drop database #{database}'"
end
|
#dump_cmd ⇒ Object
4
5
6
|
# File 'lib/dumpman/adapters/mysql.rb', line 4
def dump_cmd
"MYSQL_PWD='#{password}' mysqldump -u #{username} -h #{host} #{database} | gzip -9 > #{Dumpman.dump_file}"
end
|
#restore_cmd ⇒ Object
8
9
10
|
# File 'lib/dumpman/adapters/mysql.rb', line 8
def restore_cmd
"gunzip < #{Dumpman.dump_file} | MYSQL_PWD='#{password}' mysql -u #{username} -h #{host} #{database}"
end
|