How to make the dump of MySQL database

You may use following commands for taking mysql dump in .sql format

cd /var/lib/mysql

ll | grep database

mysqldump database > database.sql

2. If the mysql dumps available and you want to restore that you need to use following commands

cd /var/lib/mysql

ll | grep database

mysql database < database.sql

Also you may use mysqlshow for search your databse

mysqlshow |grep database

***

You may do this using phpMyAdmin

  1. Login to Cpanel>>phpMyAdmin
  2. Click on your database name
  3. Click on the tab labeled EXPORT
  4. Select all tables you want to backup (usually all)
  5. Default settings usually work, just make sure SQL is checked
  6. Check the SAVE FILE AS box
  7. Hit GO

***

You may also do this using php

exec(“mysqldump database –user=databaseuser –password=dfs435ksja > my_dump.sql”);

 

Similar Posts:

    None Found

Leave a Reply

Your email address will not be published. Required fields are marked *