Skip to main content
added 40 characters in body
Source Link
h3rrmiller
  • 13.5k
  • 5
  • 34
  • 42

Leaving a plain text password in any file is always a bad idea in case your system is ever compromised. Sometimes it is unavoidable. To make this "secure" you should limit this activity to a very limited user and also leave these sensitive options in a defaults file.

To solve your issue specifically, from the mysql man page:

If you use the short option form (-p), you cannot have a space 
between the option and the password. If you omit the password 
value following the --password or -p option on the command line, 
mysql prompts for one.

in order to fix this you would need to run:

mysqldump -u [username] -p[password] [db_name] > [path to backup file]

or

mysqldump -u [username] -password=[password] [db_name] > [path to backup file]

Leaving a plain text password in any file is always a bad idea. Sometimes it is unavoidable. To make this "secure" you should limit this activity to a very limited user.

To solve your issue specifically, from the mysql man page:

If you use the short option form (-p), you cannot have a space 
between the option and the password. If you omit the password 
value following the --password or -p option on the command line, 
mysql prompts for one.

in order to fix this you would need to run:

mysqldump -u [username] -p[password] [db_name] > [path to backup file]

or

mysqldump -u [username] -password=[password] [db_name] > [path to backup file]

Leaving a plain text password in any file is always a bad idea in case your system is ever compromised. Sometimes it is unavoidable. To make this "secure" you should limit this activity to a very limited user and also leave these sensitive options in a defaults file.

To solve your issue specifically, from the mysql man page:

If you use the short option form (-p), you cannot have a space 
between the option and the password. If you omit the password 
value following the --password or -p option on the command line, 
mysql prompts for one.

in order to fix this you would need to run:

mysqldump -u [username] -p[password] [db_name] > [path to backup file]

or

mysqldump -u [username] -password=[password] [db_name] > [path to backup file]
Source Link
h3rrmiller
  • 13.5k
  • 5
  • 34
  • 42

Leaving a plain text password in any file is always a bad idea. Sometimes it is unavoidable. To make this "secure" you should limit this activity to a very limited user.

To solve your issue specifically, from the mysql man page:

If you use the short option form (-p), you cannot have a space 
between the option and the password. If you omit the password 
value following the --password or -p option on the command line, 
mysql prompts for one.

in order to fix this you would need to run:

mysqldump -u [username] -p[password] [db_name] > [path to backup file]

or

mysqldump -u [username] -password=[password] [db_name] > [path to backup file]