MySQL备份与恢复(6)source命令恢复和mysql恢复数据
一、恢复数据库实践 1、利用source命令恢复数据库 进入mysql数据库控制台,mysql -uroot -p登录后 mysql>use 数据库 然后使用source命令,后面参数为脚本文件(如这里用到的 .sql) mysql>source oldboy_db.sql #这个文件是系统路径,默认是登陆mysql前的系统路径 [root@localhost ~]# mysql -uroot - pdubin Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 75 Server version: 5.5 . 32 - log Source distribution Copyright (c) 2000 , 2013 , Oracle and/ or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/ or its affiliates. Other names may be trademarks of their respective owners. Type