I often forget it, so it's for notes.
Click the following command.
mysqldump -u root -p testdb > dump.sql
In the above example The database name will be the root user, testdb. Output the contents of tesdb with the file name "dump.sql".
After typing the above command, you will be prompted for a password.
Click the following command.
mysql -u root -p testdb < dump.sql
In the above example The database name will be the root user, testdb. Import the dump.sql file into testdb.
After typing the above command, you will be prompted for a password.
that's all
Recommended Posts