1

i'm newbie at linux...

1. i want to make backup database(use mysqldump)
2. copy from server(use linux-server) to client PC (use linux- ubuntu 9.0)..
3. before that i want to search that DB file using terminal..
4. bcoz i dont know where the files are located 

how to do that..? please help i've never been do this..

2 Answers 2

1

Your steps should be something like this:

Variant 1 - if you can't access the database directly over the network: 0. Connect to server via ssh 1. mysqldump > /path/to/bakcup/file.sql 2. Presume you copy over ssh: scp user@server:/path/to/backup/file.sql /path/to/local/file.sql 3. you don't have to search for the db file, since you know where you saved it. I you want to search inside the db file for a particular string, you can do that with a lot of tools. As suggested above, grep is a good choice.

Variant 2 - if you can access the database on the server over the network: 1. Be sure you have mysql-client installed on your computer (there are versions both for Linux and Windows PCs) 2. use mysql dump (read the manual for exact parameters) to dump the file over the network directly to your computer

1
  • Or for variant 1, no SCP required: ssh remotehost mysqldump > localfile.sql Jul 16, 2010 at 7:53
2

Don't backup the raw database files. Use the database's dump tools (mysqldump, pg_dump, etc.) to get the actual data from the server.

3
  • and how search DB file?
    – klox
    Jul 16, 2010 at 4:50
  • with grep. the dump is plain-text.
    – akira
    Jul 16, 2010 at 5:33
  • can you give me an example??i have never use this
    – klox
    Jul 16, 2010 at 7:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .