PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 2, 2022

[FIXED] Where does mysqldump files go?

 July 02, 2022     command-line, command-line-arguments, mariadb, mysql, xampp     No comments   

Issue

I've read a post saying that I would have to use this command below, to dump my sql files

$ mysqldump -u [uname] -p db_name > db_backup.sql

However, my question is, I don't quite get where the db_backup.sql comes from. Am I suppose to create a file or is it being created as I enter any name for the backup sql? Also, where can I find the backup.sql at?

More information: I am doing this on Mariadb/phpmyadmin on the xampp shell


Solution

Whichever directory you are in when you run that command will have db_backup.sql.

The statement:

mysqldump -u user -p db_name generates an output on the terminal screen, assuming you are SSH'ed into the server. Instead of the output written on the screen, you can redirect the output to a file.

To do that, you use > db_backup.sql after the command.

If you are in directory /home/hyunjae/backups and run the command:

$ mysqldump -u [uname] -p db_name > db_backup.sql

You will see a new file created called db_backup.sql. If there's already a file with that name, it will be overwritten.

If you don't know what directory you are in, you can type pwd for present working directory.



Answered By - zedfoxus
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing