{"id":107807,"date":"2024-10-27T10:59:31","date_gmt":"2024-10-27T02:59:31","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=107807"},"modified":"2024-10-27T10:59:31","modified_gmt":"2024-10-27T02:59:31","slug":"dump-and-restore","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/dump-and-restore.html","title":{"rendered":"MySQL Dump and Restore,Stored Procedures and Triggers"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5b58\u50a8\u8fc7\u7a0b\u548c\u89e6\u53d1\u5668\u5728MySQL 5.0\u4e2d\u9996\u5148\u4ecb\u7ecd\u4e86\u3002\u6240\u4ee5\uff0c\u5982\u679c\u4f60\u8fd8\u5728\u4f7f\u7528MySQL\u65e7\u7248\u672c\u7684\u5b83\u5347\u7ea7\u5230MySQL 5.0\u6216\u66f4\u9ad8\u7248\u672c\u624d\u80fd\u4f7f\u7528\u8fd9\u4e9b\u529f\u80fd\u3002 \u672c\u6587\u5c06\u5e2e\u52a9\u4f60\u5982\u4f55\u8ba9\u5b58\u50a8\u8fc7\u7a0b\u8f6c\u50a8\u548c\u4f7f\u7528mysqldump\u547d\u4ee4\u89e6\u53d1\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u4ec0\u4e48\u662f\u5b58\u50a8\u8fc7\u7a0b\uff1f<\/strong><\/span><\/div>\n \u5b58\u50a8\u8fc7\u7a0b\uff0c\u662f\u88ab\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\u7684\u76ee\u5f55\uff0c\u5e76\u4e14\u53ef\u4ee5\u7531\u4e00\u4e2a\u7a0b\u5e8f\u3001\u4e00\u4e2a\u89e6\u53d1\u5668\u6216\u8005\u751a\u81f3\u4e00\u4e2a\u5b58\u50a8\u8fc7\u7a0b\u4ee5\u540e\u8c03\u7528\u7684\u58f0\u660e\u7684SQL\u4ee3\u7801\u6bb5\u3002<\/p>\n \u4ec0\u4e48\u662f\u89e6\u53d1\u5668\uff1f<\/strong><\/span><\/div>\n \u89e6\u53d1\u5668\u662f\u4e8b\u4ef6\u9a71\u52a8\u7684\u4e13\u5c5e\u7a0b\u5e8f\uff0c\u5b83\u4eec\u88ab\u5b58\u50a8\u4e0b\u6765\uff0c\u7531\u6570\u636e\u5e93\u7ba1\u7406\u3002\u89e6\u53d1\u5668\u662f\u53d1\u8d77\u4e00\u4e2a\u4e8b\u4ef6\u540e\u89e6\u53d1\u4e00\u4e2aSQL\u8fc7\u7a0b\uff08\u50cf\uff1aINSERT\uff0cDELETE\u6216UPDATE\uff09\u90fd\u53ef\u4ee5\u89e6\u53d1\u3002<\/p>\n \u5f53\u6211\u4eec\u6267\u884cmysqldump \uff0c\u5b83\u4f1a\u81ea\u52a8\u89e6\u53d1\u7684\u5907\u4efd\uff0c\u4f46\u9ed8\u8ba4\u4e0d\u4f1a\u5907\u4efd\u5b58\u50a8\u8fc7\u7a0b\u3002<\/p>\n \u5907\u4efd\u5b58\u50a8\u7a0b\u5e8f\u548c\u5e38\u89c1\u7684\u4f8b\u5b50<\/p>\n \u6211\u4eec\u9700\u8981\u6307\u5b9a -routines \u53c2\u6570\u6765\u5b8c\u6210\u6570\u636e\u548c\u8868\u7684\u5b58\u50a8\u8fc7\u7a0b\u7684\u5907\u4efd\u3002 \u4ee5\u4e0b\u547d\u4ee4\u5c06\u5305\u62ec\u5b58\u50a8\u8fc7\u7a0b\u7684\u6574\u4e2a\u6570\u636e\u5e93\u7684\u5907\u4efd\u3002\u4f8b\u5982\u4f60\u7684\u6570\u636e\u5e93\u540d\u79f0\u4e3a\u201cmydb\u201d\u3002<\/p>\n \r\n# mysqldump -u root -p --routines mydb > mydb.sql\r\n<\/pre>\n |