Article directory
- 1. Use the tool Navicat for MySQL to import
- Second, use the official tool MySQL Workbench to import
- 3. Import using the command line
-
- 1. Click on the start menu and enter cmd and press Enter to open the dos interface;
- 2.cd into the bin file of the MySQL installation directory;
- 3. Enter "mysql -u root -p", and then enter the database password;
- 4.create database Demo to create a new library;
- 5. Select the database use Demo; select the import path source D:\Demo.sql;
- 6. View the table show tables;
- Summarize
1. Use the tool Navicat for MySQL to import
- The specific download and usage of the tool recommends an article in the blog garden:
https://www.cnblogs.com/chyf1990/p/12987101.html
1. Open localhost_3306, select and right-click "New Database"
2. Specify the database name and character set (you can choose according to the character set type of the sql file)
3. Select the table under the database to run the SQL file
4. Select the path to import
Second, use the official tool MySQL Workbench to import
1. The first method
①. Create a new database demo (name it whatever you want), click the indicator icon (or Open SQL Script in the File column...)
②. Select the path to import the SQL file
③. Add the command to specify the library name, and click Run
Note: around line 15, 16, if you don't add it, the import will be invalid
PS: No need to save, just delete it after importing, saving will modify the sql file itself;
④. Refresh to view the results
2. The second method
①. Click Import (or Data Import in the Server column)
②. Select the path to import the file
③.Start Import
④. Refresh to view the results
3. Import using the command line
1. Click on the start menu and enter cmd and press Enter to open the dos interface;
2.cd into the bin file of the MySQL installation directory;
3. Enter "mysql -u root -p", and then enter the database password;
4.create database Demo to create a new library;
5. Select the database use Demo; select the import path source D:\Demo.sql;
6. View the table show tables;
Summarize
- All three methods are more applicable, and the first two are recommended for efficiency and convenience.