Database sql file download






















I would suggest to use dibi DB layer. I don't think every user can run the 'exec' function on the server where his projects ran on. As you already have the mysql account as well as the permission of running php website. Why not try to install phpmyadmin in the web server.

It can satisfy you with various kind of functionalities. It also written in php. You can generate a sql dump file with the shell command mysqldump. The restore from a sql file can be done by using the mysql shell command. Within PHP the shell commands can be called with the function exec :. You should only allow trusted users to restore from sql files.

If you only have one mysql user for accessing all your databases, restoring directly from a sql file does not have much more security improvement over using phpmyadmin. Using a hosting package with the ability of managing mysql users is a good solution.

Otherwise you have to verify an uploaded sql file before restoring from this file. In the following you will find three suggestions on how you could verify an uploaded file. All of the suggestions build on the assumption that you use a sql file, which has been generated on the server.

Create a digital signature at download and validate the signature at upload. For sure, you have to upload the digital signature together with the sql. Store a hash value of the downloaded sql on the server and check for existents of this hash value at upload. Using an ID for the sql files might be helpful. Save the whole sql files on the server and only allow restores from these files.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.

Learn more. How to download and upload SQL database as. Ask Question. Asked 7 years ago. Active 7 years ago. Viewed 8k times. I need a php code which downloads and uploads one database file. Backup: I need a help to download database data as. Restore: I should also be able to upload the same. EDIT I know its possible via phpmyadmin and cannot use it as I am going to let my clients download the sql file. Thank you. Can you just install phpMyAdmin and use that? Just use mysqldump,you write one line,bam,done.

Why complicate yourself with php? This is all You need to do that: stackoverflow. How can I protect my eyes from flying splinters? Show 9 more comments. Active Oldest Votes. It's easier if you don't use php for this. I don't like use the command exec but Serpes Serpes 4 4 silver badges 13 13 bronze badges.

Just use gzip to compress into a. You are right. I'm used to use tar for this kind of stuffs. Sometimes it's one file and sometimes it's more than one.

But, yes, gzip would be a better solution — Serpes. Add a comment. You can download these products free of charge from Microsoft. Download the script instnwnd. Before you can use the Northwind database, you have to run the downloaded instnwnd.

Follow the instructions in the Readme file in the repository. To install Northwind directly from within Access, do the following things:. On the results screen, select Northwind. A new window opens with a description of the Northwind database. In the new window, in the File Name text box, provide a filename for your copy of the Northwind database. AdventureWorks sample databases.

Download SSMS from the following page:. Open these explorer panes from the View menu.



0コメント

  • 1000 / 1000