Knowledgebase: MYSQL
Import/export Mysql zip,gz file command line in Linux Server

mysql Export Command:
“”””””””””””””””””””””””””””””””””””””””””””””

    # mysqldump -h  hostname  -u   mysqlusername   -p  database_name | gzip   >   database_name.sql.gz

    # mysqldump -h localhost -u root -p testdb | gzip > testdb.sql.gz

Mysql Database Import or restore:
“””””””””””””””””””””””””””””””””””””

    # gunzip <  database.sql.gz  | mysql -u root -pmysqlpasswd   databasename

    # gunzip < testdb.sql.gz | mysql -h localhost -u root -padmin testdb


Comments (0)