Skip to content

Use mariadb commands instead of mysqlΒ #103

@cogk

Description

@cogk

Just like in: frappe/frappe#22620 frappe/bench#1489

My issue is that the deprecation warning is used as a table name πŸ˜†

/bin/bash: line 1: /home/frappe/benches/…/sites/test.example.com/.migrate/mysql: Deprecated program name. It will be removed in a future release, use /usr/bin/mariadb instead.sql.gz: No such file or directory

mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-dump' instead
mysqldump: Couldn't find table: "mysql: Deprecated program name. It will be removed in a future release, use /usr/bin/mariadb instead"

Indeed, the tables property returns ["mysql: Deprecated program name. It will be removed in a future release, use /usr/bin/mariadb instead"]

agent/agent/site.py

Lines 637 to 642 in 2d8eadf

@property
def tables(self):
return self.execute(
"mysql --disable-column-names -B -e 'SHOW TABLES' "
f"-h {self.host} -u {self.user} -p{self.password} {self.database}"
)["output"].split("\n")

Which is then used as the table name:

agent/agent/site.py

Lines 458 to 459 in 2d8eadf

backup_file = os.path.join(
self.backup_directory, f"{table}.sql.gz"

And then bash complains that it can't find the file to write to it:

f" | gzip > '{backup_file}'",

And mysqldump complains that it's name is deprecated AND that the table does not exist.


Links to code on github

  1. f"mysql -h {self.host} -uroot -p{mariadb_root_password}"
  2. f"mysql -h {self.host} -uroot -p{mariadb_root_password}"
  3. f"mysqlbinlog --short-form --database {database} "
  4. "mysql -h 127.0.0.1 -P 6032 "
  5. f"mysql -h {self.host} -uroot -p{mariadb_root_password}"
  6. f"mysql -h {self.host} -uroot -p{mariadb_root_password}"
  7. f"mysql -h {self.host} -u {self.user} -p{self.password} "
  8. "mysqldump --single-transaction --quick --lock-tables=false "
  9. f"mysql -h {self.host} -u {self.user} -p{self.password} "
  10. f"mysql -h {self.host} -u {self.user} -p{self.password} "
  11. f"mysql -h {self.host} -u{self.database} -p{self.password} "
  12. "mysql --disable-column-names -B -e 'SHOW TABLES' "
  13. f"mysql -sN -h {self.host} -u{self.user} -p{self.password}"
  14. f"mysql -sN -h {self.host} -u{self.user} -p{self.password}"
  15. f"mysql -sN -h {self.host} -u{self.user} -p{self.password}"
  16. f"mysql -sN -h {self.host} -u{self.user} -p{self.password}"

List of files to change

agent/bench.py:238
agent/bench.py:254
agent/database.py:30
agent/proxysql.py:21
agent/site.py:274
agent/site.py:290
agent/site.py:320
agent/site.py:463
agent/site.py:533
agent/site.py:548
agent/site.py:630
agent/site.py:640
agent/site.py:674
agent/site.py:750
agent/site.py:791
agent/site.py:812

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions