@@ -250,7 +250,7 @@ def create_database_access_credentials(self, mode, mariadb_root_password):
250
250
"FLUSH PRIVILEGES" ,
251
251
]
252
252
for query in queries :
253
- command = f"mysql -h { self .host } -uroot -p{ mariadb_root_password } " f' -e "{ query } "'
253
+ command = f"mariadb -h { self .host } -uroot -p{ mariadb_root_password } " f' -e "{ query } "'
254
254
self .execute (command )
255
255
return {"database" : database , "user" : user , "password" : password }
256
256
@@ -263,7 +263,7 @@ def revoke_database_access_credentials(self, user, mariadb_root_password):
263
263
"FLUSH PRIVILEGES" ,
264
264
]
265
265
for query in queries :
266
- command = f"mysql -h { self .host } -uroot -p{ mariadb_root_password } " f' -e "{ query } "'
266
+ command = f"mariadb -h { self .host } -uroot -p{ mariadb_root_password } " f' -e "{ query } "'
267
267
self .execute (command )
268
268
return {}
269
269
@@ -291,7 +291,7 @@ def restore_site_tables(self):
291
291
output = self .execute (
292
292
"set -o pipefail && "
293
293
f"gunzip -c '{ backup_file_path } ' | "
294
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
294
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
295
295
f"{ self .database } " ,
296
296
executable = "/bin/bash" ,
297
297
)
@@ -441,7 +441,7 @@ def tablewise_backup(self):
441
441
backup_file = os .path .join (self .backup_directory , f"{ table } .sql.gz" )
442
442
output = self .execute (
443
443
"set -o pipefail && "
444
- "mysqldump --single-transaction --quick --lock-tables=false "
444
+ "mariadb-dump --single-transaction --quick --lock-tables=false "
445
445
f"-h { self .host } -u { self .user } -p{ self .password } "
446
446
f"{ self .database } '{ table } ' "
447
447
f" | gzip > '{ backup_file } '" ,
@@ -523,7 +523,7 @@ def _restore_touched_tables(self):
523
523
output = self .execute (
524
524
"set -o pipefail && "
525
525
f"gunzip -c '{ backup_file } ' | "
526
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
526
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
527
527
f"{ self .database } " ,
528
528
executable = "/bin/bash" ,
529
529
)
@@ -538,7 +538,7 @@ def drop_new_tables(self):
538
538
data = {"dropped" : {}}
539
539
for table in new_tables :
540
540
output = self .execute (
541
- f"mysql -h { self .host } -u { self .user } -p{ self .password } "
541
+ f"mariadb -h { self .host } -u { self .user } -p{ self .password } "
542
542
f"{ self .database } -e 'DROP TABLE `{ table } `'"
543
543
)
544
544
data ["dropped" ][table ] = output
@@ -620,7 +620,7 @@ def timezone(self):
620
620
)
621
621
try :
622
622
timezone = self .execute (
623
- f"mysql -h { self .host } -u{ self .database } -p{ self .password } "
623
+ f"mariadb -h { self .host } -u{ self .database } -p{ self .password } "
624
624
f'--connect-timeout 3 -sN -e "{ query } "'
625
625
)["output" ].strip ()
626
626
except Exception :
@@ -630,7 +630,7 @@ def timezone(self):
630
630
@property
631
631
def tables (self ):
632
632
return self .execute (
633
- "mysql --disable-column-names -B -e 'SHOW TABLES' "
633
+ "mariadb --disable-column-names -B -e 'SHOW TABLES' "
634
634
f"-h { self .host } -u { self .user } -p{ self .password } { self .database } "
635
635
)["output" ].split ("\n " )
636
636
@@ -662,7 +662,7 @@ def optimize_tables(self):
662
662
for table in tables :
663
663
query = f"OPTIMIZE TABLE `{ table } `"
664
664
self .execute (
665
- f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } " f" { self .database } -e '{ query } '"
665
+ f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } " f" { self .database } -e '{ query } '"
666
666
)
667
667
668
668
def fetch_latest_backup (self , with_files = True ):
@@ -726,7 +726,7 @@ def get_database_size(self):
726
726
f' WHERE `table_schema` = "{ self .database } "'
727
727
" GROUP BY `table_schema`"
728
728
)
729
- command = f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
729
+ command = f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
730
730
database_size = self .execute (command ).get ("output" )
731
731
732
732
try :
@@ -772,7 +772,7 @@ def get_database_free_size(self):
772
772
f' WHERE `table_schema` = "{ self .database } "'
773
773
" GROUP BY `table_schema`"
774
774
)
775
- command = f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
775
+ command = f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
776
776
database_size = self .execute (command ).get ("output" )
777
777
778
778
try :
@@ -790,7 +790,7 @@ def get_database_free_tables(self):
790
790
" AND ((`data_free` / (`data_length` + `index_length`)) > 0.2"
791
791
" OR `data_free` > 100 * 1024 * 1024)"
792
792
)
793
- command = f"mysql -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
793
+ command = f"mariadb -sN -h { self .host } -u{ self .user } -p{ self .password } " f" -e '{ query } '"
794
794
output = self .execute (command ).get ("output" )
795
795
return [line .split ("\t " ) for line in output .splitlines ()]
796
796
except Exception :
0 commit comments