Mysqldump return empty file .sqlHow can I prevent SQL injection in PHP?Run MySQLDump without Locking TablesHow do I restore a dump file from mysqldump?Skip certain tables with mysqldumpImport SQL dump into PostgreSQL databasemysqldump of all databases on Windows 7 with PHPmysqldump from inside phpTroubleshooting mysqldump via PHPmysqldump not producing any outputMySqlDump - Empty dump by using Windows

How to format long polynomial?

Replacing matching entries in one column of a file by another column from a different file

Either or Neither in sentence with another negative

Theorems that impeded progress

Prove that NP is closed under karp reduction?

Is it important to consider tone, melody, and musical form while writing a song?

Can a Warlock become Neutral Good?

"You are your self first supporter", a more proper way to say it

Collect Fourier series terms

Show that if two triangles built on parallel lines, with equal bases have the same perimeter only if they are congruent.

Voyeurism but not really

How to find program name(s) of an installed package?

Pattern match does not work in bash script

Watching something be written to a file live with tail

Is it unprofessional to ask if a job posting on GlassDoor is real?

What are these boxed doors outside store fronts in New York?

Why don't electron-positron collisions release infinite energy?

Do VLANs within a subnet need to have their own subnet for router on a stick?

What's the output of a record cartridge playing an out-of-speed record

tikz: show 0 at the axis origin

Minkowski space

Arthur Somervell: 1000 Exercises - Meaning of this notation

Why do falling prices hurt debtors?

Font hinting is lost in Chrome-like browsers (for some languages )



Mysqldump return empty file .sql


How can I prevent SQL injection in PHP?Run MySQLDump without Locking TablesHow do I restore a dump file from mysqldump?Skip certain tables with mysqldumpImport SQL dump into PostgreSQL databasemysqldump of all databases on Windows 7 with PHPmysqldump from inside phpTroubleshooting mysqldump via PHPmysqldump not producing any outputMySqlDump - Empty dump by using Windows






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm try to do a dump of my db in this way:



$output = NULL;
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
passthru($command, $output);



I've tried in this way too:



$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
exec($command);


In both ways it create an empty dump.sql



Where am I wrong? Can you help me?










share|improve this question













migrated from magento.stackexchange.com Apr 3 at 15:03


This question came from our site for users of the Magento e-Commerce platform.













  • 1





    If you echo/log that $command and run it from the command line, does it work for you?

    – aynber
    Apr 3 at 15:06











  • emvee-solutions.com/blog/…

    – Ronak Rathod
    Apr 3 at 15:46











  • @RonakRathod thank you. Is there a way to import by magento function this dump?

    – Mastafis
    yesterday











  • Most Welcome @Mastafis

    – Ronak Rathod
    yesterday











  • @RonakRathod Is there a way to import by magento function this dump?

    – Mastafis
    yesterday

















0















I'm try to do a dump of my db in this way:



$output = NULL;
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
passthru($command, $output);



I've tried in this way too:



$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
exec($command);


In both ways it create an empty dump.sql



Where am I wrong? Can you help me?










share|improve this question













migrated from magento.stackexchange.com Apr 3 at 15:03


This question came from our site for users of the Magento e-Commerce platform.













  • 1





    If you echo/log that $command and run it from the command line, does it work for you?

    – aynber
    Apr 3 at 15:06











  • emvee-solutions.com/blog/…

    – Ronak Rathod
    Apr 3 at 15:46











  • @RonakRathod thank you. Is there a way to import by magento function this dump?

    – Mastafis
    yesterday











  • Most Welcome @Mastafis

    – Ronak Rathod
    yesterday











  • @RonakRathod Is there a way to import by magento function this dump?

    – Mastafis
    yesterday













0












0








0








I'm try to do a dump of my db in this way:



$output = NULL;
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
passthru($command, $output);



I've tried in this way too:



$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
exec($command);


In both ways it create an empty dump.sql



Where am I wrong? Can you help me?










share|improve this question














I'm try to do a dump of my db in this way:



$output = NULL;
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
passthru($command, $output);



I've tried in this way too:



$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
exec($command);


In both ways it create an empty dump.sql



Where am I wrong? Can you help me?







php database






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 3 at 14:57









MastafisMastafis

1




1




migrated from magento.stackexchange.com Apr 3 at 15:03


This question came from our site for users of the Magento e-Commerce platform.









migrated from magento.stackexchange.com Apr 3 at 15:03


This question came from our site for users of the Magento e-Commerce platform.









  • 1





    If you echo/log that $command and run it from the command line, does it work for you?

    – aynber
    Apr 3 at 15:06











  • emvee-solutions.com/blog/…

    – Ronak Rathod
    Apr 3 at 15:46











  • @RonakRathod thank you. Is there a way to import by magento function this dump?

    – Mastafis
    yesterday











  • Most Welcome @Mastafis

    – Ronak Rathod
    yesterday











  • @RonakRathod Is there a way to import by magento function this dump?

    – Mastafis
    yesterday












  • 1





    If you echo/log that $command and run it from the command line, does it work for you?

    – aynber
    Apr 3 at 15:06











  • emvee-solutions.com/blog/…

    – Ronak Rathod
    Apr 3 at 15:46











  • @RonakRathod thank you. Is there a way to import by magento function this dump?

    – Mastafis
    yesterday











  • Most Welcome @Mastafis

    – Ronak Rathod
    yesterday











  • @RonakRathod Is there a way to import by magento function this dump?

    – Mastafis
    yesterday







1




1





If you echo/log that $command and run it from the command line, does it work for you?

– aynber
Apr 3 at 15:06





If you echo/log that $command and run it from the command line, does it work for you?

– aynber
Apr 3 at 15:06













emvee-solutions.com/blog/…

– Ronak Rathod
Apr 3 at 15:46





emvee-solutions.com/blog/…

– Ronak Rathod
Apr 3 at 15:46













@RonakRathod thank you. Is there a way to import by magento function this dump?

– Mastafis
yesterday





@RonakRathod thank you. Is there a way to import by magento function this dump?

– Mastafis
yesterday













Most Welcome @Mastafis

– Ronak Rathod
yesterday





Most Welcome @Mastafis

– Ronak Rathod
yesterday













@RonakRathod Is there a way to import by magento function this dump?

– Mastafis
yesterday





@RonakRathod Is there a way to import by magento function this dump?

– Mastafis
yesterday












2 Answers
2






active

oldest

votes


















2














I would suggest you to make use of the --single-transaction flag while using mysqldump.



mysqldump --single-transaction -u$dbuser -hlocalhost -p$password $dbname > dump.sql


With that said, I would suspect either a timeout (PHP or MySQL) or a out-of-memory error.



How did you executed your script? Browser or CLI?






share|improve this answer








New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

    – Mastafis
    yesterday


















1














I can not say exactly but if you are using single quotes, php variables wont be replaced with real values. You should use double quotes instead of single quotes.



Like $command="mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql";



Try to print command before execute to make sure that values are replaced with variables.



Let me know if that doesnt work, will give u an option to debug more accurately.






share|improve this answer























  • Hi, i've tried to echo it and it's correct.

    – Mastafis
    yesterday











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55498362%2fmysqldump-return-empty-file-sql%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














I would suggest you to make use of the --single-transaction flag while using mysqldump.



mysqldump --single-transaction -u$dbuser -hlocalhost -p$password $dbname > dump.sql


With that said, I would suspect either a timeout (PHP or MySQL) or a out-of-memory error.



How did you executed your script? Browser or CLI?






share|improve this answer








New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

    – Mastafis
    yesterday















2














I would suggest you to make use of the --single-transaction flag while using mysqldump.



mysqldump --single-transaction -u$dbuser -hlocalhost -p$password $dbname > dump.sql


With that said, I would suspect either a timeout (PHP or MySQL) or a out-of-memory error.



How did you executed your script? Browser or CLI?






share|improve this answer








New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

    – Mastafis
    yesterday













2












2








2







I would suggest you to make use of the --single-transaction flag while using mysqldump.



mysqldump --single-transaction -u$dbuser -hlocalhost -p$password $dbname > dump.sql


With that said, I would suspect either a timeout (PHP or MySQL) or a out-of-memory error.



How did you executed your script? Browser or CLI?






share|improve this answer








New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










I would suggest you to make use of the --single-transaction flag while using mysqldump.



mysqldump --single-transaction -u$dbuser -hlocalhost -p$password $dbname > dump.sql


With that said, I would suspect either a timeout (PHP or MySQL) or a out-of-memory error.



How did you executed your script? Browser or CLI?







share|improve this answer








New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered Apr 3 at 15:07









MACIMACI

212




212




New contributor




MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






MACI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

    – Mastafis
    yesterday

















  • I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

    – Mastafis
    yesterday
















I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

– Mastafis
yesterday





I've tried with your command by CLI but it sees a password character (@) as a separator and then returns an error on the command.

– Mastafis
yesterday













1














I can not say exactly but if you are using single quotes, php variables wont be replaced with real values. You should use double quotes instead of single quotes.



Like $command="mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql";



Try to print command before execute to make sure that values are replaced with variables.



Let me know if that doesnt work, will give u an option to debug more accurately.






share|improve this answer























  • Hi, i've tried to echo it and it's correct.

    – Mastafis
    yesterday















1














I can not say exactly but if you are using single quotes, php variables wont be replaced with real values. You should use double quotes instead of single quotes.



Like $command="mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql";



Try to print command before execute to make sure that values are replaced with variables.



Let me know if that doesnt work, will give u an option to debug more accurately.






share|improve this answer























  • Hi, i've tried to echo it and it's correct.

    – Mastafis
    yesterday













1












1








1







I can not say exactly but if you are using single quotes, php variables wont be replaced with real values. You should use double quotes instead of single quotes.



Like $command="mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql";



Try to print command before execute to make sure that values are replaced with variables.



Let me know if that doesnt work, will give u an option to debug more accurately.






share|improve this answer













I can not say exactly but if you are using single quotes, php variables wont be replaced with real values. You should use double quotes instead of single quotes.



Like $command="mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql";



Try to print command before execute to make sure that values are replaced with variables.



Let me know if that doesnt work, will give u an option to debug more accurately.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 3 at 17:07









Yash ShahYash Shah

1744




1744












  • Hi, i've tried to echo it and it's correct.

    – Mastafis
    yesterday

















  • Hi, i've tried to echo it and it's correct.

    – Mastafis
    yesterday
















Hi, i've tried to echo it and it's correct.

– Mastafis
yesterday





Hi, i've tried to echo it and it's correct.

– Mastafis
yesterday

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55498362%2fmysqldump-return-empty-file-sql%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?