I can not back up the mysql database using dump

0

I have some doubts. I need to make a copy of a database that is not on my machine, but on a server .. I am using the mysql dump command, however when I type the following command

mysqldump -u user -password & 1234 obanco > file.sql

, it returns that what is from "&" is not valid ..

like this:

"1234 is not recognized as an internal or external command or operable program or a batch file."

this "&" in the password can not exist? ...

One more thing, before using this command do I need to connect to the right bank?

prompt > mysql [-h hostname or ip] [-u hostname] [-psua_password]

I use this command? ..

Thank you in advance.

    
asked by anonymous 27.06.2016 / 17:24

2 answers

1

Robson, open your command prompt and navigate to the folder where your mysqldump executable is located, probably in the bin folder of MySqlServer.

Example:

cd\
cd "C:\Program Files\MySQL\MySQL Server 5.5\bin"

Run the mysqldump command to perform the backup:

mysqldump -h ip_servidor -p porta_servidor -u usuario -p senha_usuario nome_banco > backup.sql

You do not need the '&' in the password, unless your password is made up of it.

Replace 'ip_server' with the corresponding address of your server, as well as the fields 'server_port', 'user', 'user_password', and bank_name.     

27.06.2016 / 17:51
0

If you are on the same machine as the bank:

mysqldump -uUser -pSenha DataBase > c:\seu_backup.sql

If you are on another machine (which has mysql installed) and is on the same network as the database:

mysqldump -uUser -pSenha -hIp_do_Banco DataBase > c:\seu_backup.sq l

Note: Windows OS

    
27.06.2016 / 17:40