Reputation: 19
mysqldump -u root -p Databasename > backup.sql
How to set in this command password? I need run this command in Python script. At this time, asking me for a password.
Upvotes: 0
Views: 143
Reputation: 107608
mysqldump -u root -pPassword Databasename > backup.sql
Read this for some basic security info.
Upvotes: 1
Reputation: 34657
Assuming you're on Unix...
env MYSQL_PWD=<password> mysqldump -u root -p Databasename > backup.sql
According to the mysql docs.
Upvotes: 0