Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save casperghst42/8a50dfe4234e9859384b174a77a48737 to your computer and use it in GitHub Desktop.
Save casperghst42/8a50dfe4234e9859384b174a77a48737 to your computer and use it in GitHub Desktop.
maria-dump and mysqldump - execute command denied to user 'testuser'@'%' for routine 'sys.format_statement' (1370)
mariadb-dump: Couldn't execute 'SHOW FIELDS FROM `innodb_lock_waits`': execute command denied to user 'testuser'@'localhost' for routine 'sys.format_statement' (1370)
Solution from: https://forums.mysql.com/read.php?10,668311,668315#msg-668315
+-------------------------------------------------------------------------------------------+
| Grants for testuser@localhost |
+-------------------------------------------------------------------------------------------+
| GRANT SELECT ON *.* TO 'testuser'@'localhost' |
| GRANT LOCK TABLES, SHOW VIEW ON `sys`.* TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`extract_table_from_file_name` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`format_path` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`format_statement` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`extract_schema_from_file_name` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`ps_thread_account` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`format_time` TO 'testuser'@'localhost' |
| GRANT EXECUTE ON FUNCTION `sys`.`format_bytes` TO 'testuser'@'localhost' |
+-------------------------------------------------------------------------------------------+
9 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment