Tags

, ,

Export

Exporting your mysql database into gzipped/compressed format, assume you have installed a gzip application

C:\xampp\mysql\bin>mysqldump -uusername -ppassword database | gzip -c > ~/dump_2040-06-14.sql.gz
...

Exporting your mysql database into .sql format

C:\xampp\mysql\bin>mysqldump -uusername -p -v databasename> databasename.sql
...

Exporting mysql table

C:\xampp\mysql\bin>mysqldump -p - -user=root databasename users > users.sql
...

Import

Importing from compressed or gzipped file into database

C:\xampp\mysql>7z x -so database.sql.gz | mysql -uroot  -ppassword databasename
...

Importing from sql file into database

C:\xampp\mysql\bin>mysql -uroot -pwebdevel databasename < db.sql
...

TAKE NOTE: I’m using a PeaZip a freeware archiver. It supports the ff formats: zip, 7z, rar, tgz, etc. Mysql contains no space e.g -uroot & -ppassword

$ mysqldump -uroot -psecretpass userdb | gzip -v > userdb.gz
...
CREATE DATABASE 
CHARACTER SET=utf8
COLLATE=utf8_general_ci;
Advertisements