Import the database from local to MySQL

Loading the Database
When we download some db files to the local, we need to do import work if we want to see these db files in mysql.
Loading and Saving Databases
To load a database file, open a command prompt, and change to the directory
that the file is stored in. Then run the following command (replacing username
and filename with the appropriate names):
[Import from local to mysql]
mysql -u username -p (root requires password ) < filename .db
EG:mysql -u root -p < employee.db
Enter the password when prompted for the password after pressing Enter
[Import local from mysql]
To save a database from MySQL to a file, open a command prompt and type the
following (replacing username , databasename and filename with the appropriate
names):
mysqldump -u username -p (root requires a password ) -B databasename > filename .db
Every time there is a new db, it needs to be imported into mysql according to this operation.

Guess you like

Origin blog.csdn.net/Harvery_/article/details/124275125