The code for notes.sql is: SELECT CURRENT_USER(); SHOW GRANTS for `root`@`localhost`; SHOW GRANTS for classicmodels; #GRANT EXECUTE ON classicmodels TO `classicmodels_backup`@`localhost`; #REVOKE EXECUTE ON classicmodels.* FROM `classicmodels_backup`@`localhost`; # Privileges needed for database backup with MySQL 8.x DROP USER `classicmodels_backup`@`localhost`; CREATE USER `classicmodels_backup`@`localhost` IDENTIFIED WITH caching_sha2_password BY 'classicmodels_backup'; GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER ON classicmodels.* to `classicmodels_backup`@`localhost`; #GRANT SELECT ON mysql.proc to `classicmodels_backup`@`localhost`; # MySQL 5.x #GRANT SHOW_ROUTINE ON classicmodels.* TO `classicmodels_backup`@`localhost`; # Needed with MySQL 8.x. But no longer works. GRANT SELECT ON *.* to `classicmodels_backup`@`localhost`; # Needed with MySQL 8.x. This is bad, as user can select from all databases, all tables. SHOW GRANTS for `classicmodels_backup`@`localhost`; SELECT * FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES WHERE TABLE_SCHEMA = 'classicmodels'; SHOW DATABASES; USE mysql; SHOW tables; USE information_schema; SHOW tables; FLUSH PRIVILEGES;