How to import and export big database files
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.
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.
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].