Sometimes using phpmyadmin, it’s kind of impossible to import DB from the import section. So below is the command to import large DB into MySQL.
Step-1 Login to MySQL using following command
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
Step-2 Select DB in which you want to import DB
Step-3 Import DB
SET autocommit=0 ; source PATH_TO_YOUR_SQL_FILE.sql ; COMMIT ;
Don’t forget to change path!!!
I’ve made a video for this tutorial. Because that’s the easiest way to show how we can use WP-CLI to import/export database.
And if you like the video then subscribe my channel and share this with others who want to learn WordPress.
Sometimes you get the below error while importing the database.
ERROR 1031 (HY000) at line 5643 in file: '/Users/username/Downloads/database.sql': Table storage engine for 'table_name' doesn't have this option
Now let’s fix this.
Step – 1
Open your sql file in your favourite editor and go to SQL query of that table.
You will see
ROW_FORMAT=FIXED at the last of the query and remove that.
Step – 2
Save your file and try to import the database. This should fix the error.