3 ms·
I use it to install MySQL with some non default values. I'm not that good with bash and install scripts and expect was the only way around some issues I was hav
by iaskwhy 12y ago
I use it to install MySQL with some non default values. I'm not that good with bash and install scripts and expect was the only way around some issues I was having.
secure_mysql_script=$(expect -c '
spawn sudo mysql_secure_installation
expect "Enter current password for root (enter for none):"
send "\r"
expect "Change the root password?"
send "n\r"
expect "Remove anonymous users?"
send "y\r"
expect "Disallow root login remotely?"
send "y\r"
expect "Remove test database and access to it?"
send "y\r"
expect "Reload privilege tables now?"
send "y\r"
expect eof
')
echo "$secure_mysql_script"