Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Dump to Directory

Tags:

mysql

I'm currently trying to make a copy of a site to run locally, and i'm having some difficulty in downloading a dump of the mySQL database using PhpMyAdmin. (In that it doesn't work). I was wondering (and I suspect) if there is an sql command I can execute that would dump out the database to a location that I can download it via FTP.

I've found the following:

 mysqldump --opt --user=root --password password > /home/backup/db.sql

but the page says that this will only run via shell, and I don't have shel access to the server. Can anyone help?

like image 953
gunwin Avatar asked Jul 16 '11 09:07

gunwin


People also ask

What is dump folder in MySQL?

It dumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump command can also generate output in CSV, other delimited text, or XML format.

Where does MySQL dump go?

It is at either at root or in current directory where you run the dump command. try this command on terminal.. hmm.. locate myBackup.

How do I dump a MySQL database?

To dump/export a MySQL database, execute the following command in the Windows command prompt: mysqldump -u username -p dbname > filename. sql . After entering that command you will be prompted for your password.


2 Answers

mysqldump -u root -p -T/path/ database
like image 142
Camilla Avatar answered Sep 22 '22 16:09

Camilla


PERFORM MySQL DATABASE DUMP:

  1. Having registered mysql.exe in the Paths of Environment Variables (On Windows Os)
  2. Open windows console
  3. Type the following Query:

    mysqldump [Your database Name] -u root -p > C:/[Your Destination Directory ]/[ new Backup Database Name.sql ]

  4. You will be prompted for a database user password
  5. Enter Password:*******
  6. when the dump is over...the directory will go back to the current user session in Windows console

For this to work well, replace all parameters in square braces "[ ]" with your own values without the square braces

like image 37
Asiimwe Apollo Avatar answered Sep 20 '22 16:09

Asiimwe Apollo