[root@test tmp]# du -sh test.sql
17G test.sql
mysqldump备份的文件
[root@test ~]# mysql -uroot -ptestpassword --default-character-set=utf8 test < /tmp/test.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'test'
报错
MySQL [(none)]> create database test;
Query OK, 1 row affected (0.00 sec)
[root@test ~]# mysql -uroot -ptestpassword --default-character-set=utf8 test < /tmp/test.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
还原完成
[root@test ~]# mysql -uroot -p数据库密码 --default-character-set=utf8 数据库 < /tmp/pousheng_b2b2c_prepub2017101.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
数据库文件都在这个目录下:
[root@test mysql]# pwd
/data/mysql
[root@test mysql]# du -sh test
23G test
还原后的数据库大小
Mysql 5.7.26通过mysqldump还原数据库[root@test tmp]# du -sh test.sql17G test.sqlmysqldump备份的文件[root@test ~]# mysql -uroot -ptestpassword --default-character-set=utf8 test < /tmp/test.sqlmysql: [W...