开发者

MySQL table exporting and importing using a file - without phpMyAdmin?

It'd be nice if I could request a backup file (such as a .sql or .csv) for my MySQL table through my site, so I would be able to 'reset' the table in case anything goes wrong. These two actions, exporting and importing, are explained here, but in my case it'd be much better if this could be done via a web interface of some kind, without accessing phpMyAdmin directly. Is this possible? If so, what开发者_如何学Python PHP functions should I be taking a look at?


See this MySQL doc page and look for the INTO OUTFILE option that allows you to write your results directly to a file without even reading them from PHP.


Use mysqldump

mysqldump -u username -ppassword -h hostname database_name > db_name_backup.sql

Mysqldump documentation is here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜