Need help in exporting and importing database in mysql forma

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

Need help in exporting and importing database in mysql forma

Post by rajsekar2u »

Hi all,

i need help in php mysql
am creating a web page for that i need to import and export database in sql format
please help me in this
its urgent
thanks in advance
rajasekar
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Need help in exporting and importing database in mysql forma

Post by jaoudestudios »

If you have phpmyadmin installed, copy the code from there :D
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

Re: Need help in exporting and importing database in mysql forma

Post by rajsekar2u »

I've phpmyadmin...
but i didnt got any php script for export or import in that.....
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Need help in exporting and importing database in mysql forma

Post by jaoudestudios »

Its not going to give you the scripts, you will have to dive into the source code!
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

Re: Need help in exporting and importing database in mysql forma

Post by rajsekar2u »

Thx.......
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Need help in exporting and importing database in mysql forma

Post by Eran »

If you have the mysql command line installed, you could use shell_exec to dump through it:

Code: Select all

shell_exec("mysqldump -u[username] -p[password] -d --skip-add-drop-table [database] > path/to/database.sql");
Replace username/password/database/path to fit your configuration.
Post Reply