MySQL从备份文件还原

时间:2018-10-25 14:35:13

标签: mysql mariadb database-backups database-restore

我使用命令# List the file shares on the remote server: SERVER64. $shares = Get-WmiObject -class Win32_Share -computername SERVER64 -filter "Type=0" $shares | foreach { $path=($_.path) $Description=($_.Description) $name=($_.name) $Caption=($_.Caption) "Share Name : $name Source Folder: $path Description : $Description Caption : $Caption" } 在mysql中的数据库中进行了备份,并将其正确保存在文件中,但是在创建数据库后使用命令mysqldump -u root -p Test > test.sql将其还原到其他数据库中时,全新且干净的mysql -u root -p Test2 < test.sql数据库,它会还原最初备份的Test2数据库,而不是我想要的数据库,如果有人可以告诉我如何更改此行为或我在做什么错,我会我会感激的。谢谢

1 个答案:

答案 0 :(得分:0)

请遵循此代码。

步骤1:

mysql -u <user> -p < db_backup.dump

第2步

USE <database-name-here>;

我希望它将对您有帮助

相关问题