Mimi Bubu
Mimi Bubu

Reputation: 19

mysqldump. How to set in this command password?

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

Answers (2)

Jochen Ritzel
Jochen Ritzel

Reputation: 107608

mysqldump -u root -pPassword Databasename > backup.sql

Read this for some basic security info.

Upvotes: 1

hd1
hd1

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

Related Questions