I'm automating the process of creating WordPress sites with a custom shell script. Is it possible to encrypt MYSQL passwords with BCrypt for WordPress? If so, what's the best way to approach this?
Snippet:
#!/bin/bash
execute="
CREATE DATABASE IF NOT EXISTS $dbName;
GRANT SELECT, INSERT, UPDATE, DELETE
ON $dbName.*
TO '$dbUser'@'localhost' IDENTIFIED BY '$dbPass';
FLUSH PRIVILEGES;
"
mysql -uroot -p --show-warnings -e "$execute"
With Ruby, I can encrypt it like so:
encryptedPass="$(ruby -e "require'bcrypt';puts BCrypt::Password.create('$dbPass')")"