Page 1 of 1

backing up SQL database not working ?

Posted: Wed Jun 24, 2020 9:48 pm
by exxos

Code: Select all

mysqldump -u [user] -p [password] --all-databases > ./backup/all_databases.sql
This create this sql file

Code: Select all

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
Anyone know what I did wrong ?!

Re: backing up SQL database not working ?

Posted: Wed Jun 24, 2020 9:56 pm
by czietz
man mysqldump:
• --password[=password], -p[password]

The password to use when connecting to the server. If you use the
short option form (-p), you cannot have a space between the option
and the password.

Re: backing up SQL database not working ?

Posted: Wed Jun 24, 2020 10:01 pm
by exxos
I figured it out, it didn't like the brackets in the username, thought they were supposed to be there :roll:

Re: backing up SQL database not working ?

Posted: Wed Jun 24, 2020 10:43 pm
by rpineau
on command help, the bracket are here to show you the parameter is optional, they are not part of the command options, so [user] mean that you should replace [user] by the username .
If you don't specify it at all , it'll ask for it.