Janne.D
Janne.D

Reputation: 3

Save mysql password in a bash script and use it instead of cmd line

So , i'm writing an auto mysql database installer in bash. I want to store the mysql password intro the bash script as a variable and use it directly.

Will create database.

mysqladmin -u root -p create account

PASSWD = "PASS"
mysqladmin -u root -p $PASSWD create account

How should i store corectly the password ?

Upvotes: 0

Views: 122

Answers (1)

colorgreen
colorgreen

Reputation: 315

put password with -p without space mysqladmin -u root -p$PASSWD create account

Upvotes: 1

Related Questions