Bug #92631 | importing dump from mysqldump --all-databases breaks SYS schema due to routines | ||
---|---|---|---|
Submitted: | 2 Oct 2018 8:07 | Modified: | 2 Oct 2018 9:26 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: mysqldump Command-line Client | Severity: | S3 (Non-critical) |
Version: | 5.7.23 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[2 Oct 2018 8:07]
Shane Bester
[2 Oct 2018 8:13]
MySQL Verification Team
Documented workaround: https://dev.mysql.com/doc/refman/5.7/en/sys-schema-usage.html Neither mysqldump nor mysqlpump dump the sys schema by default. To generate a dump file, name the sys schema explicitly on the command line using either of these commands: mysqldump --databases --routines sys > sys_dump.sql mysqlpump sys > sys_dump.sql To reinstall the schema from the dump file, use this command: mysql < sys_dump.sql
[2 Oct 2018 9:26]
MySQL Verification Team
Thank you for the bug report. miguel@luz:~/dbs $ 5.7/bin/mysql -uroot --socket=/tmp/mysql57.sock -e "SHOW VARIABLES LIKE '%VERSION%'" +-------------------------+----------------------------------------+ | Variable_name | Value | +-------------------------+----------------------------------------+ | innodb_version | 5.7.25 | | protocol_version | 10 | | slave_type_conversions | | | tls_version | TLSv1,TLSv1.1 | | version | 5.7.25 | | version_comment | Source distribution BUILD: 2018-SET-27 | | version_compile_machine | x86_64 | | version_compile_os | Linux | +-------------------------+----------------------------------------+ miguel@luz:~/dbs $ 5.7/bin/mysqldump -uroot --socket=/tmp/mysql57.sock --all-databases --routines -uroot > t.sql miguel@luz:~/dbs $ 5.7/bin/mysql -uroot --socket=/tmp/mysql57.sock < t.sql miguel@luz:~/dbs $ 5.7/bin/mysql -uroot --socket=/tmp/mysql57.sock -e "select * from sys.memory_global_total;" ERROR 1356 (HY000) at line 1: View 'sys.memory_global_total' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them miguel@luz:~/dbs $