mysql uses the mysqldump command to manually back up the database and regularly back up the database under Windows

cmd console:

First enter the bin directory where mysql is located, such as: cd C:\Program Files\MySQL\MySQL Server 5.5\bin

mysqldump –u root –p database [table name 1 table name 2..] > file path

For example: backup the datacenter database to c:\datacenter.sql

mysqldump –u root –p datacenter> c:\datacenter.sql

If you want to backup some tables of the database

mysqldump –u root –prot datacenter user > d:\aa.sql

 

How to restore our data using backup files.

mysql console:

source c:\datacenter.sql

If an error is reported: ERROR 1046 (3D000): No database selected

Then mysql first use the database name, and then execute the source command

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325039051&siteId=291194637