soycharliente Posted July 17, 2007 Share Posted July 17, 2007 I was trying to figure out how to backup a db table. I found this line: SELECT * INTO OUTFILE 'file_name' FROM tbl_name Where does that actually save the file to? It is possible to just create another table with a different name? Link to comment https://forums.phpfreaks.com/topic/60425-solved-db-backup/ Share on other sites More sharing options...
effigy Posted July 17, 2007 Share Posted July 17, 2007 What kind of tables (MyISAM, InnoDB)? I pair up mysqldump with a cron script, as well as use binary logging. If a path is not specified it writes the file to the current database's directory. You can create a new table via CREATE TABLE name SELECT * from other_table. Link to comment https://forums.phpfreaks.com/topic/60425-solved-db-backup/#findComment-300574 Share on other sites More sharing options...
soycharliente Posted July 17, 2007 Author Share Posted July 17, 2007 I'm using MyISAM. I wanted to be able to just click a button on say an admin options page and either just create another table with the exact same data or e-mail myself a file with the MySQL dump. Link to comment https://forums.phpfreaks.com/topic/60425-solved-db-backup/#findComment-300593 Share on other sites More sharing options...
effigy Posted July 17, 2007 Share Posted July 17, 2007 mysqldump would probably be the best route since it's more of a backup than copying a table. Plus, when you use CREATE TABLE with a SELECT statement, there are some subtle differences that will not carry over. Link to comment https://forums.phpfreaks.com/topic/60425-solved-db-backup/#findComment-300602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.