@@ -272,7 +272,7 @@ def create_database_access_credentials(self, mode, mariadb_root_password):
272
272
]
273
273
for query in queries :
274
274
command = (
275
- f"mysql -h { self .host } -uroot -p{ mariadb_root_password } "
275
+ f"mariadb -h { self .host } -uroot -p{ mariadb_root_password } "
276
276
f' -e "{ query } "'
277
277
)
278
278
self .execute (command )
@@ -288,7 +288,7 @@ def revoke_database_access_credentials(self, user, mariadb_root_password):
288
288
]
289
289
for query in queries :
290
290
command = (
291
- f"mysql -h { self .host } -uroot -p{ mariadb_root_password } "
291
+ f"mariadb -h { self .host } -uroot -p{ mariadb_root_password } "
292
292
f' -e "{ query } "'
293
293
)
294
294
self .execute (command )
@@ -318,7 +318,7 @@ def restore_site_tables(self):
318
318
output = self .execute (
319
319
"set -o pipefail && "
320
320
f"gunzip -c '{ backup_file_path } ' | "
321
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
321
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
322
322
f"{ self .database } " ,
323
323
executable = "/bin/bash" ,
324
324
)
@@ -474,7 +474,7 @@ def tablewise_backup(self):
474
474
)
475
475
output = self .execute (
476
476
"set -o pipefail && "
477
- "mysqldump --single-transaction --quick --lock-tables=false "
477
+ "mariadb-dump --single-transaction --quick --lock-tables=false "
478
478
f"-h { self .host } -u { self .user } -p{ self .password } "
479
479
f"{ self .database } '{ table } ' "
480
480
f" | gzip > '{ backup_file } '" ,
@@ -544,7 +544,7 @@ def restore_touched_tables(self):
544
544
output = self .execute (
545
545
"set -o pipefail && "
546
546
f"gunzip -c '{ backup_file } ' | "
547
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
547
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
548
548
f"{ self .database } " ,
549
549
executable = "/bin/bash" ,
550
550
)
@@ -559,7 +559,7 @@ def drop_new_tables(self):
559
559
data = {"dropped" : {}}
560
560
for table in new_tables :
561
561
output = self .execute (
562
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
562
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
563
563
f"{ self .database } -e 'DROP TABLE `{ table } `'"
564
564
)
565
565
data ["dropped" ][table ] = output
@@ -641,7 +641,7 @@ def timezone(self):
641
641
)
642
642
try :
643
643
timezone = self .execute (
644
- f"mysql -h { self .host } -u{ self .database } -p{ self .password } "
644
+ f"mariadb -h { self .host } -u{ self .database } -p{ self .password } "
645
645
f'--connect-timeout 3 -sN -e "{ query } "'
646
646
)["output" ].strip ()
647
647
except Exception :
@@ -651,7 +651,7 @@ def timezone(self):
651
651
@property
652
652
def tables (self ):
653
653
return self .execute (
654
- "mysql --disable-column-names -B -e 'SHOW TABLES' "
654
+ "mariadb --disable-column-names -B -e 'SHOW TABLES' "
655
655
f"-h { self .host } -u { self .user } -p{ self .password } { self .database } "
656
656
)["output" ].split ("\n " )
657
657
@@ -685,7 +685,7 @@ def optimize_tables(self):
685
685
for table in tables :
686
686
query = f"OPTIMIZE TABLE `{ table } `"
687
687
self .execute (
688
- f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } "
688
+ f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } "
689
689
f" { self .database } -e '{ query } '"
690
690
)
691
691
@@ -761,7 +761,7 @@ def get_database_size(self):
761
761
" GROUP BY `table_schema`"
762
762
)
763
763
command = (
764
- f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } "
764
+ f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } "
765
765
f" -e '{ query } '"
766
766
)
767
767
database_size = self .execute (command ).get ("output" )
@@ -810,7 +810,7 @@ def get_database_free_size(self):
810
810
" GROUP BY `table_schema`"
811
811
)
812
812
command = (
813
- f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } "
813
+ f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } "
814
814
f" -e '{ query } '"
815
815
)
816
816
database_size = self .execute (command ).get ("output" )
@@ -831,7 +831,7 @@ def get_database_free_tables(self):
831
831
" OR `data_free` > 100 * 1024 * 1024)"
832
832
)
833
833
command = (
834
- f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } "
834
+ f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } "
835
835
f" -e '{ query } '"
836
836
)
837
837
output = self .execute (command ).get ("output" )
0 commit comments