MySQL Issues

apt-get update fails

It looks like this is caused by the debian maintainer account settings not being in sync with the actual MySQL account. Possibly, the issue is that the account is lost when a new database is created (using db_install_???). The following link describes the issue:

https://mirzmaster.wordpress.com/2009/01/16/mysql-access-denied-for-user-debian-sys-maintlocalhost/

mysqldump failing

Am currently using following parameters:

mysqldump
	--defaults-extra-file=/home/ubuntu/conf/mysql.cnf
	--column-statistics=0
	--force
	--set-gtid-purged=OFF
	--single-transaction
	--no-create-info
	--complete-insert
	--replace
	--extended-insert
	--no-tablespaces
	--skip-triggers
	-h {{hostname}}
	--ssl-ca=/path/to/rds-combined-ca-bundle.pem
	--ssl-mode=VERIFY_IDENTITY
	{{dbname}}
	>  /path/to/backup.sql

The latest version (8.0.32-0ubuntu0.20.04.2) of MySQL broke backups with AWS. I had to down grade to the previous version (8.0.19-0ubuntu5).

To find package of a file:

# dpkg -S `which mysql`
mysql-client-core-8.0: /usr/bin/mysql

To find existing available versions:

# apt-cache showpkg mysql-client-core-8.0
Package: mysql-client-core-8.0
Versions: 
8.0.32-0ubuntu0.20.04.2 ...
...
8.0.19-0ubuntu5 ...
...

To downgrade to previous version:

# apt install mysql-client-core-8.0=8.0.19-0ubuntu5

To prevent upgrade in the future we need to "hold" that package:

# sudo apt-mark hold mysql-client-core-8.0

References

How to downgrade a package via apt-get?

How do I find the package that provides a file?