Restoring a MySQL table back to the database

后端 未结 4 927
栀梦
栀梦 2021-02-04 01:36

I have a trouble in restoring MySQL table back to the database from command line. Taking backup of a table is working with mysqldump.Taking backup and restoring of a database i

4条回答
  •  梦如初夏
    2021-02-04 01:42

    Copy your db.sql file to your Mysql Server if you are in a remote machine:

    $rsync -Cravzp --progress db.sql user@192.168.10.1:/home/user

    Now you can go to your remote server as:

    $ssh -l user 192.168.10.1

    In the Mysql Server you must to do this:

    user@machine:~$mysql -h localhost -u root -p

    Obs: The file db.sql must be in the same place (/home/user).

    Now type this command in you Mysql Server:

    mysql>'\'. db.sql + Enter. Obs: Remove all ' from this command to work

提交回复
热议问题