---
title: "How to create mysql database  backup file using PHP?"  
description: "How to create mysql database  backup file using PHP?"  
author: "Pravesh Singh"  
published: 2012-03-10  
updated: 2012-03-12  
canonical: https://www.mindstick.com/forum/390/how-to-create-mysql-database-backup-file-using-php  
category: "mysql"  
tags: ["mysql"]  
reading_time: 1 minute  

---

# How to create mysql database  backup file using PHP?

Hello Guys,\
I'm troubling with one [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic), actually I want to create a [backup](https://www.mindstick.com/interview/1205/what-is-the-command-to-take-backup-and-restore-for-sharepoint-site) of [MYSQL database](https://answers.mindstick.com/qa/38302/what-is-the-main-difference-between-innodb-myisam-mysql-database-engines). So, could you tell me how to perform this task.\
\
Please [resolve](https://www.mindstick.com/forum/159427/windows-app-dll-not-found-resolve-library-issue) my problem as soon as possible.\

## Replies

### Reply by Anonymous User

Hello Pravesh Singh,\
It is not big issue, to resolve this problem you can use following query...\
Query: "SELECT * INTO OUTFILE '$backupFile' FROM $tableName";\
\
Where, \
$backupFile -> is backup file name with path.\
$tableName -> is that table for which you create backup.\
\
I hope it might be helpful for you.


---

Original Source: https://www.mindstick.com/forum/390/how-to-create-mysql-database-backup-file-using-php

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
