Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mariadb commands instead of mysql #103

Open
cogk opened this issue May 17, 2024 · 0 comments Β· May be fixed by #108
Open

Use mariadb commands instead of mysql #103

cogk opened this issue May 17, 2024 · 0 comments Β· May be fixed by #108

Comments

@cogk
Copy link

cogk commented May 17, 2024

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
@cogk cogk linked a pull request Jul 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant