Your email address will not be published. This site uses Akismet to reduce spam. Learn how your comment data is processed. Close Menu Home. Open File Types Show sub menu. DB Database. Fix File Errors Show sub menu. DLL File Error. DLL Files Error. DLL Missing Error. Other Articles Show sub menu. How to use DLL as Plugins. The following commands are used for creating the database and table:.
Next Recommended Reading. Visual Studio Vs Visual Studio Getting Started With. NET 6. C Evolution. Understanding Matplotlib With Examples. Understanding Numpy With Examples. Understanding Pandas With Examples. It should replace the available data database. I know its possible via phpmyadmin and cannot use it as I am going to let my clients download the sql file.
And I cannot give them my phpmyadmin password. And more-over its not essential that I need to do it via. I suggest that you write a bash script that do what I've wrote before. It could send the dump to another server or whatever you want. Use php for this is a bit strange. I guess it is vulnerable to hand-over database uploading to Clients. I've learned it from this comment. Thank you, Henrik.
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.
0コメント