How to import and export big database files

in mysql / 1 Comment

Hello friends,

today i want to share some basic concepts but we need to know about import and export databases. If it is small database file, we can directly export or import from the phpmyadmin.

Process to export:

1) Go to phpmyadmin -> click on database -> there we have button called “export”.

2) When we click on that button, we got a screen like in which format do want to export from database ( Like .sql,.txt,.zip,.zar or just open it that browser) 3) When we click on “Go” button, we will get database backup file.

Database export at phpmyadmin | Anil Labs

Database export at phpmyadmin | Anil Labs

Process to import:
1) We have the database, but we want to import database to that existing database.
2) Click on “import” button and then we have the separate screen click on browse and select the database file and click on “Go” button, it will successfully import the database.

Database import at phpmyadmin | Anil Labs

Database import at phpmyadmin | Anil Labs

So it is successfully complete the export and import in GUI format, when there is limited size of database. When there is exceed the limit it gives the database size then we got the error message something like
” Allowed memory ( xxxx) ” ….


So, to overcome this problem we have another solution to import and export the database to server.

1) Process to export: ( local or SSH )
Run this command at DOS or putty.exe file or at terminal(linux)

mysqldump -u [username] -p [ database ] > [path][backup_database] .sql

After run the command, it will asking for the password, once we entered the password the backup (dump) “.sql” file will be we are successfully export database at mentioned [path].

2) Process to import : ( local or SSH)
Run this command at DOS or putty.exe file or at terminal (linux)

mysqldump -u [username] -p [ database ] < [path][backup_database] .sql

After run the command, it will asking for the password, once we entered the password the backup (dump) “.sql” file from mentioned [path] to imported to [database].

Thank you.

With more than 9 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

Discussion 1 Comment

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>