您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“怎么解決MySQL5.7的mysqldump routines問(wèn)題”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“怎么解決MySQL5.7的mysqldump routines問(wèn)題”吧!
場(chǎng)景:
1 新建一個(gè)5.7.12的實(shí)例
2 導(dǎo)出全庫(kù)
mysqldump --all-databases -uroot -ptest --set-gtid-purged=off --single-transaction --quick -R --events > /tmp/a.sql
3 導(dǎo)出前檢查:
mysql> select count(*) from mysql.proc;
+----------+
| count(*) |
+----------+
| 47 |
+----------+
1 row in set (0.00 sec)
mysql> select * from host_summary;
+-----------+------------+-------------------+-----------------------+-------------+----------+-----------------+---------------------+-------------------+--------------+----------------+------------------------+
| host | statements | statement_latency | statement_avg_latency | table_scans | file_ios | file_io_latency | current_connections | total_connections | unique_users | current_memory | total_memory_allocated |
+-----------+------------+-------------------+-----------------------+-------------+----------+-----------------+---------------------+-------------------+--------------+----------------+------------------------+
| localhost | 1823 | 1.14 s | 623.98 us | 468 | 7000 | 714.18 ms | 1 | 7 | 1 | 0 bytes | 0 bytes |
+-----------+------------+-------------------+-----------------------+-------------+----------+-----------------+---------------------+-------------------+--------------+----------------+------------------------+
1 row in set (0.04 sec)
4 全庫(kù)導(dǎo)入:
mysql -uroot -ptest < /tmp/a.sql
5 mysql> select count(*) from mysql.proc;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> select * from sys.host_summary;
ERROR 1356 (HY000): View 'sys.host_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
5.5 5.6中是沒(méi)有這個(gè)問(wèn)題的
因?yàn)樗麄兿到y(tǒng)自帶的沒(méi)有proc.
兩個(gè)方式避免:
1 不導(dǎo)出mysql.proc表
mysqldump --all-databases -uroot -ptest --set-gtid-purged=off --single-transaction --quick -R --events --ignore-table=mysql.proc > /tmp/a.sql
2 導(dǎo)入完成后upgrade
所以,無(wú)論是哪種備份方式,還原好之后最好都要執(zhí)行下upgrade。
另:
使用innobackup的方式?jīng)]有這個(gè)問(wèn)題。
到此,相信大家對(duì)“怎么解決MySQL5.7的mysqldump routines問(wèn)題”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢(xún),關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。