Suresh Payankannur

Monday, September 29, 2014

MySQL Import and Export

To import and export and entire database schema and data, follow these steps:
mysqldump -h host -u user -p --databases database-name > dump.sql # Export from a database
sed '/^\/\*\!50013 DEFINER/d' dump.sql > dump_0.sql # Fix the permission issues in case you have views
mysql -u user -p database-name < dump_0.sql         # Import to database


Post a Comment

Blog Archive

Scroll To Top