i want export mysql database to text file,
please help me.
Thanks.
How to export mysql database to text file?
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
phpMyAdmin is a very good tool that supports this in many formats.
What format do you want to export the database to? SQL, CSV, Tabbed, something else?
What format do you want to export the database to? SQL, CSV, Tabbed, something else?
I want back up automatically and user can't use phpMyAdminfeyd wrote:phpMyAdmin is a very good tool that supports this in many formats.
What format do you want to export the database to? SQL, CSV, Tabbed, something else?
I want to write it by code.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
there's a facility in MySQL itself to export the data of a table: http://dev.mysql.com/doc/mysql/en/SELECT.html read the SELECT ... INTO OUTFILE parts.
You may have access to exec() and so could run: http://dev.mysql.com/doc/mysql/en/mysqldump.html
The manual way is slightly more complex, in that you have to get the table's structure, and re-engineer the query to create it.. then fetch all the rows and create insert queries for each of those as well.
We've talked about getting the table structure a little bit, recently: viewtopic.php?t=29183
You may have access to exec() and so could run: http://dev.mysql.com/doc/mysql/en/mysqldump.html
The manual way is slightly more complex, in that you have to get the table's structure, and re-engineer the query to create it.. then fetch all the rows and create insert queries for each of those as well.
We've talked about getting the table structure a little bit, recently: viewtopic.php?t=29183