Roger
Roger

Reputation: 3959

mysql restoring data on localmachine where the password is empty

I use a ruby program to download data from staging server and to populate that data to my local mysql server where the userid is root and password is empty.

cmd = "mysql -u #{user}  -p'#{password}' my_db < out.sql"

Since password is empty, I get prompted for password. I just have to hit enter. I would like to avoid that. What's the fix?

Upvotes: 0

Views: 45

Answers (1)

Andy West
Andy West

Reputation: 12509

Omit the -p option.

Upvotes: 1

Related Questions