1. Export all databases
Use Mysqldump's-all-databases parameter to export all the databases under your database root to a SQL file in one breath. Then, after reloading the system, use the source command to rewind back in a breath.
You need to determine the path to the MySQL installation: C:\Program files\mysql\mysql Server 5.7\bin, there is mysqldump.exe in this folder, so you can execute the mysqldump command.
Method: Enter the MySQL command line input: Show variables like "%char%";
Export all databases Mysqldump-uroot-p--all-databases > E:/sqlfile.sql
This will lead to all databases under the root user of the database server. If you are prompted after enter Password: Please enter your MySQL root password.
2. Export a Database
Mysqldump-u root-p test1 >e:/kuku1.sql
3. Import a Database
You need to determine the path to the MySQL installation: C:\Program files\mysql\mysql Server 5.7\bin, there is mysql.exe in this folder, so you can execute the MySQL command.
Login mysql:mysql–uroot–p, follow the prompts to enter the password
Create a database test3, in E:\kuku1.sql have this file
Select Test3 database: Use TEST3;
Input Import command: source E:\kuku1.sql;
Import and export MySQL data using commands